home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Resources / Online / Term / Extras / Source / gtlayout-source.lha / LT_New.c < prev    next >
C/C++ Source or Header  |  1996-10-08  |  91KB  |  3,421 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1996 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14.  
  15. /*****************************************************************************/
  16.  
  17.  
  18. /* As of V33 FRACTION_KIND is no longer supported. */
  19. #define FRACTION_KIND 50
  20.  
  21.  
  22. /*****************************************************************************/
  23.  
  24.  
  25. VOID
  26. LT_AddL(LayoutHandle *handle,LONG type,ULONG labelID,LONG id,...)
  27. {
  28.     if(handle)
  29.     {
  30.         struct TagItem    *tagList;
  31.         va_list          varArg;
  32.  
  33.         va_start(varArg,id);
  34.  
  35.         tagList = (struct TagItem *)varArg;
  36.  
  37.         if(handle->LocaleHook)
  38.         {
  39.             STRPTR label;
  40.  
  41.             label = (STRPTR)CallHookPkt(handle->LocaleHook,handle,(APTR)labelID);
  42.  
  43.             LT_AddA(handle,type,label,id,tagList);
  44.         }
  45.         else
  46.             handle->Failed = TRUE;
  47.  
  48.         va_end(varArgs);
  49.     }
  50. }
  51.  
  52.  
  53. /*****************************************************************************/
  54.  
  55.  
  56. VOID
  57. LT_New(LayoutHandle *handle,...)
  58. {
  59.     va_list VarArgs;
  60.  
  61.     va_start(VarArgs,handle);
  62.     LT_NewA(handle,(struct TagItem *)VarArgs);
  63.     va_end(VarArgs);
  64. }
  65.  
  66.  
  67. /*****************************************************************************/
  68.  
  69.  
  70. VOID
  71. LT_Add(LayoutHandle *Handle,LONG Type,STRPTR Label,LONG ID,...)
  72. {
  73.     va_list VarArgs;
  74.  
  75.     va_start(VarArgs,ID);
  76.     LT_AddA(Handle,Type,Label,ID,(struct TagItem *)VarArgs);
  77.     va_end(VarArgs);
  78. }
  79.  
  80.  
  81. /*****************************************************************************/
  82.  
  83.  
  84. VOID LIBENT
  85. LT_AddA(REG(a0) LayoutHandle *Handle,REG(d0) LONG Type,REG(d1) STRPTR Label,REG(d2) LONG ID,REG(a1) struct TagItem *TagList)
  86. {
  87.     struct TagItem *TagItem;
  88.  
  89.     if(!Handle || Handle->Failed)
  90.         return;
  91.  
  92.     if(Type < GENERIC_KIND || Type == FRACTION_KIND)
  93.     {
  94.         Handle->Failed = TRUE;
  95.         return;
  96.     }
  97.  
  98.     if(Type == VERTICAL_KIND || Type == HORIZONTAL_KIND || Handle->TopGroup)
  99.     {
  100.         ObjectNode *Node;
  101.         ULONG IDCMP;
  102.  
  103.         IDCMP = NULL;
  104.  
  105.         switch(Type)
  106.         {
  107.             case BUTTON_KIND:
  108.  
  109.                 IDCMP = BUTTONIDCMP;
  110.                 break;
  111.  
  112.             case CHECKBOX_KIND:
  113.  
  114.                 IDCMP = CHECKBOXIDCMP | IDCMP_MOUSEBUTTONS;
  115.                 break;
  116.  
  117.             case LISTVIEW_KIND:
  118.  
  119.                 IDCMP = LISTVIEWIDCMP;
  120.                 break;
  121.  
  122.             case MX_KIND:
  123.  
  124.                 IDCMP = MXIDCMP | IDCMP_MOUSEBUTTONS;
  125.                 break;
  126.  
  127.             case CYCLE_KIND:
  128.  
  129.                 IDCMP = CYCLEIDCMP;
  130.                 break;
  131.  
  132.             case PALETTE_KIND:
  133.  
  134.                 IDCMP = PALETTEIDCMP;
  135.                 break;
  136.  
  137.             case SLIDER_KIND:
  138.  
  139.                 IDCMP = SLIDERIDCMP;
  140.                 break;
  141.  
  142.             case SCROLLER_KIND:
  143.  
  144.                 IDCMP = SCROLLERIDCMP | ARROWIDCMP;
  145.                 break;
  146.  
  147.             case INTEGER_KIND:
  148.  
  149.                 IDCMP = STRINGIDCMP | IDCMP_GADGETDOWN | IDCMP_INTUITICKS;
  150.                 break;
  151.  
  152.             case FRAME_KIND:
  153.  
  154.                 IDCMP = IDCMP_MOUSEBUTTONS;
  155.                 break;
  156.  
  157.             case STRING_KIND:
  158.             case PASSWORD_KIND:
  159.  
  160.                 IDCMP = STRINGIDCMP | IDCMP_GADGETDOWN;
  161.                 break;
  162.  
  163. #ifdef DO_LEVEL_KIND
  164.             case LEVEL_KIND:
  165.  
  166.                 IDCMP = IDCMP_GADGETDOWN | IDCMP_MOUSEMOVE | IDCMP_GADGETUP;
  167.                 break;
  168. #endif    /* DO_LEVEL_KIND */
  169.  
  170.             case END_KIND:
  171.  
  172.                 Handle->CurrentGroup = Handle->CurrentGroup->Special.Group.ParentGroup;
  173.                 return;
  174.  
  175. #if defined(DO_POPUP_KIND) && defined(DO_BOOPSI_KIND)
  176.             case POPUP_KIND:
  177.  
  178.                 IDCMP = IDCMP_GADGETUP;
  179.  
  180.                 if(!V39)
  181.                     Type = CYCLE_KIND;    // POPUP_KIND doesn't work well under v37
  182.  
  183.                 break;
  184. #endif
  185.  
  186. #if defined(DO_TAB_KIND) && defined(DO_BOOPSI_KIND)
  187.             case TAB_KIND:
  188.  
  189.                 IDCMP = IDCMP_GADGETUP;
  190.                 break;
  191. #endif
  192.         }
  193.  
  194.         Handle->IDCMP |= IDCMP;
  195.  
  196.         if(Node = LTP_CreateObjectNode(Handle,Type,ID,Label))
  197.         {
  198.             struct MinList *ParentList;
  199.             LONG FirstLabel;
  200.             LONG LastLabel;
  201.             LONG *LabelTable;
  202.             LONG *LineTable;
  203.             LONG FirstLine;
  204.             LONG LastLine;
  205.             STRPTR BoxLine;
  206.  
  207.             BoxLine = NULL;
  208.             LabelTable = LineTable = NULL;
  209.             FirstLabel = LastLabel = FirstLine = LastLine = -1;
  210.             Type = Node->Type;
  211.  
  212.             if(Type == GROUP_KIND)
  213.             {
  214.                 Node->Special.Group.ParentGroup = Handle->CurrentGroup;
  215.  
  216.                 if(!ID)
  217.                     Node->ID = Handle->GroupID--;
  218.  
  219.                 if(!Handle->TopGroup)
  220.                 {
  221.                     Handle->TopGroup = Node;
  222.  
  223.                     ParentList = NULL;
  224.                 }
  225.                 else
  226.                     ParentList = &Handle->CurrentGroup->Special.Group.ObjectList;
  227.  
  228.                 Handle->CurrentGroup = Node;
  229.  
  230.                 NewList((struct List *)&Node->Special.Group.ObjectList);
  231.             }
  232.             else
  233.                 ParentList = &Handle->CurrentGroup->Special.Group.ObjectList;
  234.  
  235.             if(Label && !Node->NoKey)
  236.             {
  237.                 LONG Len;
  238.  
  239.                 for(Len = 0 ; Label[Len] ; Len++)
  240.                 {
  241.                     if(Label[Len] == '_')
  242.                     {
  243.                         Node->Key = ToLower(Label[Len + 1]);
  244.  
  245.                         break;
  246.                     }
  247.                 }
  248.             }
  249.  
  250.             if(TagList)
  251.             {
  252.                 struct TagItem *TempList = TagList;
  253.  
  254.                 while(TagItem = NextTagItem(&TempList))
  255.                 {
  256.                     switch(TagItem->ti_Tag)
  257.                     {
  258.                         case LA_BYTE:
  259.  
  260.                             Node->Storage         = (APTR)TagItem->ti_Data;
  261.                             Node->StorageType    = STORAGE_BYTE;
  262.  
  263.                             LTP_GetStorage(Node);
  264.  
  265.                             break;
  266.  
  267.                         case LA_UBYTE:
  268.  
  269.                             Node->Storage         = (APTR)TagItem->ti_Data;
  270.                             Node->StorageType    = STORAGE_UBYTE;
  271.  
  272.                             LTP_GetStorage(Node);
  273.  
  274.                             break;
  275.  
  276.                         case LA_WORD:
  277.  
  278.                             Node->Storage         = (APTR)TagItem->ti_Data;
  279.                             Node->StorageType    = STORAGE_WORD;
  280.  
  281.                             LTP_GetStorage(Node);
  282.  
  283.                             break;
  284.  
  285.                         case LA_UWORD:
  286.  
  287.                             Node->Storage         = (APTR)TagItem->ti_Data;
  288.                             Node->StorageType    = STORAGE_UWORD;
  289.  
  290.                             LTP_GetStorage(Node);
  291.  
  292.                             break;
  293.  
  294.                         case LA_LONG:
  295.  
  296.                             Node->Storage         = (APTR)TagItem->ti_Data;
  297.                             Node->StorageType    = STORAGE_LONG;
  298.  
  299.                             LTP_GetStorage(Node);
  300.  
  301.                             break;
  302.  
  303.                         case LA_ULONG:
  304.  
  305.                             Node->Storage         = (APTR)TagItem->ti_Data;
  306.                             Node->StorageType    = STORAGE_ULONG;
  307.  
  308.                             LTP_GetStorage(Node);
  309.  
  310.                             break;
  311.  
  312.                         case LA_STRPTR:
  313.  
  314.                             Node->Storage         = (APTR)TagItem->ti_Data;
  315.                             Node->StorageType    = STORAGE_STRPTR;
  316.  
  317.                             LTP_GetStorage(Node);
  318.  
  319.                             break;
  320.  
  321.                         case LAXB_FullSize:
  322.  
  323.                             if(Type == XBAR_KIND || Type == YBAR_KIND)
  324.                                 Node->Special.Bar.FullSize = TagItem->ti_Data;
  325.  
  326.                             break;
  327.  
  328.                         case LA_LabelTable:
  329.  
  330.                             LabelTable = (LONG *)TagItem->ti_Data;
  331.                             break;
  332.  
  333.                         case LA_FirstLabel:
  334.  
  335.                             FirstLabel = TagItem->ti_Data;
  336.                             break;
  337.  
  338.                         case LA_LastLabel:
  339.  
  340.                             LastLabel = TagItem->ti_Data;
  341.                             break;
  342.  
  343.                         case LA_LastGadget:
  344.  
  345.                             if(Type == INTEGER_KIND)
  346.                                 Node->Special.Integer.LastGadget = TagItem->ti_Data;
  347.  
  348.                             if(Type == STRING_KIND || Type == PASSWORD_KIND)
  349.                                 Node->Special.String.LastGadget = TagItem->ti_Data;
  350.  
  351.                             break;
  352.  
  353.                         case LA_LabelChars:
  354.  
  355.                             Node->LabelChars = TagItem->ti_Data;
  356.  
  357.                             break;
  358.  
  359.                         case LA_HistoryLines:
  360.  
  361.                             if(Type == INTEGER_KIND)
  362.                                 Node->Special.Integer.MaxHistoryLines = TagItem->ti_Data;
  363.  
  364.                             if(Type == STRING_KIND || Type == PASSWORD_KIND)
  365.                                 Node->Special.String.MaxHistoryLines = TagItem->ti_Data;
  366.  
  367.                             break;
  368.  
  369.                         case LA_HistoryHook:
  370.  
  371.                             if(Type == INTEGER_KIND)
  372.                                 Node->Special.Integer.HistoryHook = (struct Hook *)TagItem->ti_Data;
  373.  
  374.                             if(Type == STRING_KIND)
  375.                                 Node->Special.String.HistoryHook = (struct Hook *)TagItem->ti_Data;
  376.  
  377.                             break;
  378.  
  379.                         case LAIN_IncrementerHook:
  380.  
  381.                             if(Type == INTEGER_KIND)
  382.                                 Node->Special.Integer.IncrementerHook = (struct Hook *)TagItem->ti_Data;
  383.  
  384.                             break;
  385.  
  386.                         case LA_Min:
  387.  
  388.                             Node->Min = TagItem->ti_Data;
  389.  
  390.                             break;
  391.  
  392.                         case LA_Max:
  393.  
  394.                             Node->Max = TagItem->ti_Data;
  395.  
  396.                             break;
  397.  
  398.                         case LABX_ReserveSpace:
  399.  
  400.                             if(Type == BOX_KIND)
  401.                                 Node->Special.Box.ReserveSpace = TagItem->ti_Data;
  402.  
  403.                             break;
  404.  
  405.                         case LA_Chars:
  406.  
  407.                             Node->Chars = TagItem->ti_Data;
  408.  
  409.                             break;
  410.  
  411.                         case LA_LabelPlace:
  412.  
  413.                             Node->LabelPlace = TagItem->ti_Data;
  414.  
  415.                             if(Type == MX_KIND)
  416.                             {
  417.                                 if(TagItem->ti_Data == PLACE_RIGHT)
  418.                                     Node->LabelPlace = PLACE_RIGHT;
  419.                                 else
  420.                                     Node->LabelPlace = PLACE_LEFT;
  421.                             }
  422.  
  423.                             break;
  424.  
  425.                         case LA_ExtraSpace:
  426.  
  427.                             Node->ExtraSpace = (WORD)TagItem->ti_Data;
  428.  
  429.                             if(Node->ExtraSpace == 1)
  430.                                 Node->ExtraSpace = 3;
  431.  
  432.                             break;
  433.  
  434.                         case LA_PageSelector:
  435.  
  436.                             Node->PageSelector = TagItem->ti_Data;
  437.                             break;
  438.  
  439.                         case LABT_ExtraFat:
  440.  
  441.                             if(Node->Type == BUTTON_KIND)
  442.                                 Node->Special.Button.ExtraFat = TagItem->ti_Data;
  443.  
  444.                             break;
  445.  
  446.                         case LABT_Smaller:
  447.  
  448.                             if(Node->Type == BUTTON_KIND)
  449.                                 Node->Special.Button.Smaller = TagItem->ti_Data;
  450.  
  451.                             break;
  452.  
  453.                         case LABT_DefaultCorrection:
  454.  
  455.                             if(Node->Type == BUTTON_KIND)
  456.                                 Node->Special.Button.DefaultCorrection = TagItem->ti_Data;
  457.  
  458.                             break;
  459.  
  460.                         case LABT_Lines:
  461.  
  462.                             if(Node->Type == BUTTON_KIND)
  463.                                 Node->Special.Button.Lines = (STRPTR *)TagItem->ti_Data;
  464.  
  465.                             break;
  466. #ifdef DO_PICKSHORTCUTS
  467.                         case LA_NoKey:
  468.  
  469.                             Node->NoKey = TagItem->ti_Data;
  470.                             break;
  471. #endif
  472.                         case LA_HighLabel:
  473.  
  474.                             Node->HighLabel = TagItem->ti_Data;
  475.                             break;
  476.  
  477.                         case LAPA_SmallPalette:
  478.  
  479.                             if(Type == PALETTE_KIND)
  480.                                 Node->Special.Palette.SmallPalette = TagItem->ti_Data;
  481.  
  482.                             break;
  483.  
  484.                         case LAPA_UsePicker:
  485.  
  486.                             if(Type == PALETTE_KIND)
  487.                                 Node->Special.Palette.UsePicker = TagItem->ti_Data;
  488.  
  489.                             break;
  490.  
  491.                         case LA_Lines:
  492.  
  493.                             if(Type == BOX_KIND)
  494.                             {
  495.                                 LONG Count = TagItem->ti_Data;
  496.  
  497.                                 if(Node->Lines != Count)
  498.                                 {
  499.                                     LTP_Free(Handle,Node->Special.Box.Lines,sizeof(STRPTR) * Node->Lines);
  500.  
  501.                                     Node->Special.Box.Lines = NULL;
  502.                                 }
  503.  
  504.                                 if(!Node->Special.Box.Lines)
  505.                                 {
  506.                                     if(Node->Special.Box.Lines = (STRPTR *)LTP_Alloc(Handle,sizeof(STRPTR) * Count))
  507.                                     {
  508.                                         LONG i;
  509.  
  510.                                         for(i = 0 ; i < Count ; i++)
  511.                                             Node->Special.Box.Lines[i] = "";
  512.                                     }
  513.                                 }
  514.                             }
  515.  
  516.                             Node->Lines = TagItem->ti_Data;
  517.  
  518.                             break;
  519.  
  520.                         case LA_Picker:
  521.  
  522.                             if(Type == TEXT_KIND)
  523.                                 Node->Special.Text.UsePicker = TagItem->ti_Data;
  524.  
  525.                             if(Type == STRING_KIND)
  526.                                 Node->Special.String.UsePicker = TagItem->ti_Data;
  527.  
  528.                             break;
  529.  
  530.                         case LACY_AutoPageID:
  531.  
  532.                             if(Type == CYCLE_KIND)
  533.                                 Node->Special.Cycle.AutoPageID = (LONG)TagItem->ti_Data;
  534.  
  535. #if defined(DO_POPUP_KIND) && defined(DO_BOOPSI_KIND)
  536.                             if(Type == POPUP_KIND)
  537.                                 Node->Special.Popup.AutoPageID = (LONG)TagItem->ti_Data;
  538. #endif
  539.  
  540. #if defined(DO_TAB_KIND) && defined(DO_BOOPSI_KIND)
  541.                             if(Type == TAB_KIND)
  542.                                 Node->Special.Tab.AutoPageID = (LONG)TagItem->ti_Data;
  543. #endif
  544.  
  545.                             if(Type == MX_KIND)
  546.                                 Node->Special.Radio.AutoPageID = (LONG)TagItem->ti_Data;
  547.  
  548.                             if(Type == LISTVIEW_KIND)
  549.                                 Node->Special.List.AutoPageID = (LONG)TagItem->ti_Data;
  550.  
  551.                             break;
  552.  
  553.                         case LAGR_Spread:
  554.  
  555.                             if(Type == GROUP_KIND)
  556.                                 Node->Special.Group.Spread = TagItem->ti_Data;
  557.  
  558.                             break;
  559. #ifdef NOT_FUNCTIONAL
  560.                         case LAGR_SameWidth:
  561.  
  562.                             if(Type == GROUP_KIND)
  563.                                 Node->Special.Group.UseWidth = TagItem->ti_Data;
  564.  
  565.                             break;
  566.  
  567.                         case LAGR_SameHeight:
  568.  
  569.                             if(Type == GROUP_KIND)
  570.                                 Node->Special.Group.UseHeight = TagItem->ti_Data;
  571.  
  572.                             break;
  573. #endif    // NOT_FUNCTIONAL
  574.                         case LAGR_NoIndent:
  575.  
  576.                             if(Type == GROUP_KIND)
  577.                                 Node->Special.Group.NoIndent = TagItem->ti_Data;
  578.  
  579.                             break;
  580.  
  581.                         case LAGR_IndentX:
  582.  
  583.                             if(Type == GROUP_KIND)
  584.                                 Node->Special.Group.IndentX = TagItem->ti_Data;
  585.  
  586.                             break;
  587.  
  588.                         case LAGR_IndentY:
  589.  
  590.                             if(Type == GROUP_KIND)
  591.                                 Node->Special.Group.IndentY = TagItem->ti_Data;
  592.  
  593.                             break;
  594.  
  595.                         case LAGR_Frame:
  596.  
  597.                             if(Type == GROUP_KIND)
  598.                                 Node->Special.Group.Frame = TagItem->ti_Data;
  599.  
  600.                             break;
  601.  
  602.                         case LAGR_SameSize:
  603.  
  604.                             if(Type == GROUP_KIND)
  605.                                 Node->Special.Group.SameSize = TagItem->ti_Data;
  606.  
  607.                             break;
  608.  
  609.                         case LAGR_LastAttributes:
  610.  
  611.                             if(Type == GROUP_KIND)
  612.                                 Node->Special.Group.LastAttributes = TagItem->ti_Data;
  613.  
  614.                             break;
  615.  
  616.                         case LAGR_ActivePage:
  617.  
  618.                             if(Type == GROUP_KIND)
  619.                             {
  620.                                 Node->Special.Group.ActivePage    = TagItem->ti_Data;
  621.                                 Node->Special.Group.Paging    = TRUE;
  622.                             }
  623.  
  624.                             break;
  625.  
  626.                         case LABT_ReturnKey:
  627.  
  628.                             if(Type == BUTTON_KIND)
  629.                                 Node->Special.Button.ReturnKey = TagItem->ti_Data;
  630.  
  631.                             break;
  632.  
  633.                         case LABT_EscKey:
  634.  
  635.                             if(Type == BUTTON_KIND)
  636.                                 Node->Special.Button.EscKey = TagItem->ti_Data;
  637.  
  638.                             break;
  639.  
  640.                         case LALV_CursorKey:
  641.  
  642.                             if(Type == LISTVIEW_KIND)
  643.                                 Node->Special.List.CursorKey = TagItem->ti_Data;
  644.  
  645.                             break;
  646.  
  647.                         case LALV_TextAttr:
  648.  
  649.                             if(Type == LISTVIEW_KIND)
  650.                                 Node->Special.List.TextAttr = (struct TextAttr *)TagItem->ti_Data;
  651.  
  652.                             break;
  653.  
  654.                         case LALV_LockSize:
  655.  
  656.                             if(Type == LISTVIEW_KIND)
  657.                                 Node->Special.List.LockSize = TagItem->ti_Data;
  658.  
  659.                             if(Type == TEXT_KIND)
  660.                                 Node->Special.Text.LockSize = TagItem->ti_Data;
  661.  
  662.                             break;
  663.  
  664.                         case LALV_MaxGrowX:
  665.  
  666.                             if(Type == LISTVIEW_KIND)
  667.                             {
  668.                                 Handle->GrowView = Node;
  669.  
  670.                                 Node->Special.List.MaxGrowX = TagItem->ti_Data;
  671.                             }
  672.  
  673.                             break;
  674.  
  675.                         case LALV_MaxGrowY:
  676.  
  677.                             if(Type == LISTVIEW_KIND)
  678.                             {
  679.                                 Handle->GrowView = Node;
  680.  
  681.                                 Node->Special.List.MaxGrowY = TagItem->ti_Data;
  682.                             }
  683.  
  684.                             break;
  685.  
  686.                         case LALV_ResizeX:
  687.  
  688.                             if(Type == LISTVIEW_KIND)
  689.                             {
  690.                                 Handle->ResizeView = Node;
  691.  
  692.                                 Handle->IDCMP |= IDCMP_SIZEVERIFY | IDCMP_NEWSIZE;
  693.  
  694.                                 Node->Special.List.ResizeX = TagItem->ti_Data;
  695.                             }
  696.  
  697.                             break;
  698.  
  699.                         case LALV_ResizeY:
  700.  
  701.                             if(Type == LISTVIEW_KIND)
  702.                             {
  703.                                 Handle->ResizeView = Node;
  704.  
  705.                                 Handle->IDCMP |= IDCMP_SIZEVERIFY | IDCMP_NEWSIZE;
  706.  
  707.                                 Node->Special.List.ResizeY = TagItem->ti_Data;
  708.                             }
  709.  
  710.                             break;
  711.  
  712.                         case LALV_MinChars:
  713.  
  714.                             if(Type == LISTVIEW_KIND)
  715.                                 Node->Special.List.MinChars = TagItem->ti_Data;
  716.  
  717.                             break;
  718.  
  719.                         case LALV_MinLines:
  720.  
  721.                             if(Type == LISTVIEW_KIND)
  722.                                 Node->Special.List.MinLines = TagItem->ti_Data;
  723.  
  724.                             break;
  725.  
  726.                         case LALV_FlushLabelLeft:
  727.  
  728.                             if(Type == LISTVIEW_KIND)
  729.                                 Node->Special.List.FlushLabelLeft = TagItem->ti_Data;
  730.  
  731.                             break;
  732.  
  733.                         case LALV_Labels:
  734.  
  735.                             if(Type == LISTVIEW_KIND)
  736.                             {
  737.                                 STRPTR *Labels = (STRPTR *)TagItem->ti_Data;
  738.  
  739.                                 if(*Labels)
  740.                                 {
  741.                                     struct List *SomeList;
  742.  
  743.                                     if(SomeList = LTP_Alloc(Handle,sizeof(struct List)))
  744.                                     {
  745.                                         struct Node *SomeNode;
  746.  
  747.                                         NewList(SomeList);
  748.  
  749.                                         Node->Special.List.Labels = SomeList;
  750.  
  751.                                         while(*Labels)
  752.                                         {
  753.                                             if(SomeNode = LTP_Alloc(Handle,sizeof(struct Node) + strlen(*Labels) + 1))
  754.                                             {
  755.                                                 SomeNode->ln_Name = (STRPTR)(SomeNode + 1);
  756.  
  757.                                                 strcpy(SomeNode->ln_Name,*Labels++);
  758.  
  759.                                                 AddTail(SomeList,SomeNode);
  760.                                             }
  761.                                         }
  762.                                     }
  763.                                 }
  764.                             }
  765.  
  766.                             break;
  767.  
  768.                         case LA_Link:
  769.  
  770.                             if(Type == LISTVIEW_KIND)
  771.                                 Node->Special.List.LinkID = TagItem->ti_Data;
  772.  
  773.                             if(Type == STRING_KIND)
  774.                                 Node->Special.String.LinkID = TagItem->ti_Data;
  775.  
  776.                             if(Type == BOOPSI_KIND)
  777.                                 Node->Special.BOOPSI.Link = (LONG)TagItem->ti_Data;
  778.  
  779.                             break;
  780.  
  781. #ifdef DO_TAPEDECK_KIND
  782.                         case LATD_ButtonType:
  783.  
  784.                             if(Type == TAPEDECK_KIND)
  785.                                 Node->Special.TapeDeck.ButtonType = TagItem->ti_Data;
  786.  
  787.                             break;
  788.  
  789.                         case LATD_Toggle:
  790.  
  791.                             if(Type == TAPEDECK_KIND)
  792.                                 Node->Special.TapeDeck.Toggle = TagItem->ti_Data;
  793.  
  794.                             break;
  795.  
  796.                         case LATD_Pressed:
  797.  
  798.                             if(Type == TAPEDECK_KIND)
  799.                                 Node->Current = TagItem->ti_Data;
  800.  
  801.                             break;
  802.  
  803.                         case LATD_Tick:
  804.  
  805.                             if(Type == TAPEDECK_KIND)
  806.                                 Node->Special.TapeDeck.Tick = TagItem->ti_Data;
  807.  
  808.                             break;
  809.  
  810.                         case LATD_Smaller:
  811.  
  812.                             if(Type == TAPEDECK_KIND)
  813.                                 Node->Special.TapeDeck.Smaller = TagItem->ti_Data;
  814.  
  815.                             break;
  816. #endif    /* DO_TAPEDECK_KIND */
  817.  
  818. #ifdef DO_GAUGE_KIND
  819.                         case LAGA_Percent:
  820.  
  821.                             if(Type == GAUGE_KIND)
  822.                             {
  823.                                 LONG Percent = (LONG)TagItem->ti_Data;
  824.  
  825.                                 if(Percent <= 0)
  826.                                     Node->Current = 0;
  827.                                 else
  828.                                 {
  829.                                     if(Percent > 100)
  830.                                         Node->Current = 100;
  831.                                     else
  832.                                         Node->Current = Percent;
  833.                                 }
  834.                             }
  835.  
  836.                             break;
  837.  
  838.                         case LAGA_NoTicks:
  839.  
  840.                             if(Type == GAUGE_KIND)
  841.                                 Node->Special.Gauge.NoTicks = TagItem->ti_Data;
  842.  
  843.                             break;
  844.  
  845.                         case LAGA_Discrete:
  846.  
  847.                             if(Type == GAUGE_KIND)
  848.                                 Node->Special.Gauge.Discrete = TagItem->ti_Data;
  849.  
  850.                             break;
  851.  
  852.                         case LAGA_InfoLength:
  853.  
  854.                             if(Type == GAUGE_KIND)
  855.                             {
  856.                                 LONG Length = (LONG)TagItem->ti_Data;
  857.  
  858.                                 if(Length > Node->Special.Gauge.InfoLength)
  859.                                 {
  860.                                     STRPTR NewText;
  861.  
  862.                                     if(NewText = (STRPTR)LTP_Alloc(Handle,Length + 1))
  863.                                     {
  864.                                         if(Node->Special.Gauge.InfoText)
  865.                                         {
  866.                                             strcpy(NewText,Node->Special.Gauge.InfoText);
  867.  
  868.                                             LTP_Free(Handle,Node->Special.Gauge.InfoText,Node->Special.Gauge.InfoLength + 1);
  869.                                         }
  870.  
  871.                                         NewText[0] = 0;
  872.  
  873.                                         Node->Special.Gauge.InfoText    = NewText;
  874.                                         Node->Special.Gauge.InfoLength    = Length;
  875.                                     }
  876.                                 }
  877.                             }
  878.  
  879.                             break;
  880.  
  881.                         case LAGA_InfoText:
  882.  
  883.                             if(Type == GAUGE_KIND)
  884.                             {
  885.                                 STRPTR    SomeText    = (STRPTR)TagItem->ti_Data;
  886.                                 LONG    Len            = strlen(SomeText);
  887.  
  888.                                 if(!Node->Special.Gauge.InfoLength)
  889.                                 {
  890.                                     if(Node->Special.Gauge.InfoText = (STRPTR)LTP_Alloc(Handle,Len + 1))
  891.                                         Node->Special.Gauge.InfoLength = Len;
  892.                                 }
  893.  
  894.                                 if(Node->Special.Gauge.InfoLength)
  895.                                 {
  896.                                     if(Len > Node->Special.Gauge.InfoLength)
  897.                                         Len = Node->Special.Gauge.InfoLength;
  898.  
  899.                                     CopyMem(SomeText,Node->Special.Gauge.InfoText,Len);
  900.  
  901.                                     Node->Special.Gauge.InfoText[Len] = 0;
  902.                                 }
  903.                             }
  904.  
  905.                             break;
  906. #endif
  907.                         case LALV_ExtraLabels:
  908.  
  909.                             if(Type == LISTVIEW_KIND)
  910.                                 Node->Special.List.ExtraLabels = (STRPTR *)TagItem->ti_Data;
  911.  
  912.                             break;
  913.  
  914.                         case LACY_TabKey:
  915.  
  916.                             if(Type == CYCLE_KIND)
  917.                                 Node->Special.Cycle.TabKey = TagItem->ti_Data;
  918.  
  919. #if defined(DO_POPUP_KIND) && defined(DO_BOOPSI_KIND)
  920.                             if(Type == POPUP_KIND)
  921.                                 Node->Special.Popup.TabKey = TagItem->ti_Data;
  922. #endif
  923.  
  924. #if defined(DO_TAB_KIND) && defined(DO_TAB_KIND)
  925.                             if(Type == TAB_KIND)
  926.                                 Node->Special.Tab.TabKey = TagItem->ti_Data;
  927. #endif
  928.  
  929.                             if(Type == MX_KIND)
  930.                                 Node->Special.Radio.TabKey = TagItem->ti_Data;
  931.  
  932.                             break;
  933.  
  934. #if defined(DO_TAB_KIND) && defined(DO_TAB_KIND)
  935.                         case LATB_FullWidth:
  936.  
  937.                             if(Type == TAB_KIND)
  938.                                 Node->Special.Tab.FullWidth = TagItem->ti_Data;
  939.  
  940.                             break;
  941. #endif
  942.  
  943. #ifdef DO_BOOPSI_KIND
  944.                         case LABO_FullWidth:
  945.  
  946.                             if(Type == BOOPSI_KIND)
  947.                                 Node->Special.BOOPSI.FullWidth = (WORD)TagItem->ti_Data;
  948.  
  949.                             break;
  950.  
  951.                         case LABO_ActivateHook:
  952.  
  953.                             if(Type == BOOPSI_KIND)
  954.                                 Node->Special.BOOPSI.ActivateHook = (struct Hook *)TagItem->ti_Data;
  955.  
  956.                             break;
  957.  
  958.                         case LABO_FullHeight:
  959.  
  960.                             if(Type == BOOPSI_KIND)
  961.                                 Node->Special.BOOPSI.FullHeight = (WORD)TagItem->ti_Data;
  962.  
  963.                             break;
  964.  
  965.                         case LABO_RelFontHeight:
  966.  
  967.                             if(Type == BOOPSI_KIND)
  968.                                 Node->Special.BOOPSI.RelFontHeight = (WORD)TagItem->ti_Data;
  969.  
  970.                             break;
  971.  
  972.                         case LABO_TagScreen:
  973.  
  974.                             if(Type == BOOPSI_KIND)
  975.                                 Node->Special.BOOPSI.TagScreen = TagItem->ti_Data;
  976.  
  977.                             break;
  978.  
  979.                         case LABO_TagCurrent:
  980.  
  981.                             if(Type == BOOPSI_KIND)
  982.                                 Node->Special.BOOPSI.TagCurrent = TagItem->ti_Data;
  983.  
  984.                             break;
  985.  
  986.                         case LABO_TagLink:
  987.  
  988.                             if(Type == BOOPSI_KIND)
  989.                                 Node->Special.BOOPSI.TagLink = TagItem->ti_Data;
  990.  
  991.                             break;
  992.  
  993.                         case LABO_ExactWidth:
  994.  
  995.                             if(Type == BOOPSI_KIND)
  996.                                 Node->Special.BOOPSI.ExactWidth = TagItem->ti_Data;
  997.  
  998.                             break;
  999.  
  1000.                         case LABO_ExactHeight:
  1001.  
  1002.                             if(Type == BOOPSI_KIND)
  1003.                                 Node->Special.BOOPSI.ExactHeight = TagItem->ti_Data;
  1004.  
  1005.                             break;
  1006.  
  1007.                         case LABO_TagTextAttr:
  1008.  
  1009.                             if(Type == BOOPSI_KIND)
  1010.                                 Node->Special.BOOPSI.TagTextAttr = TagItem->ti_Data;
  1011.  
  1012.                             break;
  1013.  
  1014.                         case LABO_TagDrawInfo:
  1015.  
  1016.                             if(Type == BOOPSI_KIND)
  1017.                                 Node->Special.BOOPSI.TagDrawInfo = TagItem->ti_Data;
  1018.  
  1019.                             break;
  1020.  
  1021.                         case LABO_ClassInstance:
  1022.  
  1023.                             if(Type == BOOPSI_KIND)
  1024.                                 Node->Special.BOOPSI.ClassInstance = (Class *)TagItem->ti_Data;
  1025.  
  1026.                             break;
  1027.  
  1028.                         case LABO_ClassName:
  1029.  
  1030.                             if(Type == BOOPSI_KIND)
  1031.                                 Node->Special.BOOPSI.ClassName = (STRPTR)TagItem->ti_Data;
  1032.  
  1033.                             break;
  1034.  
  1035.                         case LABO_ClassLibraryName:
  1036.  
  1037.                             if(Type == BOOPSI_KIND)
  1038.                                 Node->Special.BOOPSI.ClassLibraryName = (STRPTR)TagItem->ti_Data;
  1039.  
  1040.                             break;
  1041. #endif    /* DO_BOOPSI_KIND */
  1042.  
  1043.                         case LAFR_RefreshHook:
  1044.  
  1045.                             if(Type == FRAME_KIND)
  1046.                                 Node->Special.Frame.RefreshHook = (struct Hook *)TagItem->ti_Data;
  1047.  
  1048.                             break;
  1049.  
  1050.                         case LAFR_InnerWidth:
  1051.  
  1052.                             if(Type == FRAME_KIND)
  1053.                                 Node->Special.Frame.InnerWidth = TagItem->ti_Data;
  1054.  
  1055.                             break;
  1056.  
  1057.                         case LAFR_InnerHeight:
  1058.  
  1059.                             if(Type == FRAME_KIND)
  1060.                                 Node->Special.Frame.InnerHeight = TagItem->ti_Data;
  1061.  
  1062.                             break;
  1063.  
  1064.                         case LA_DrawBox:
  1065.  
  1066.                             if(Type == FRAME_KIND)
  1067.                                 Node->Special.Frame.DrawBox = TagItem->ti_Data;
  1068.  
  1069.                             if(Type == BOX_KIND)
  1070.                                 Node->Special.Box.DrawBox = TagItem->ti_Data;
  1071.  
  1072.                             break;
  1073.  
  1074.                         case LAFR_GenerateEvents:
  1075.  
  1076.                             if(Type == FRAME_KIND)
  1077.                                 Node->Special.Frame.GenerateEvents = TagItem->ti_Data;
  1078.  
  1079.                             break;
  1080.  
  1081.                         case LABX_AlignText:
  1082.  
  1083.                             if(Type == BOX_KIND)
  1084.                                 Node->Special.Box.AlignText = TagItem->ti_Data;
  1085.  
  1086.                             break;
  1087.  
  1088.                         case LABX_Line:
  1089.  
  1090.                             if(Type == BOX_KIND)
  1091.                                 BoxLine = (STRPTR)TagItem->ti_Data;
  1092.  
  1093.                             break;
  1094.  
  1095.                         case LABX_LineID:
  1096.  
  1097.                             if(Type == BOX_KIND)
  1098.                             {
  1099.                                 if(Handle->LocaleHook)
  1100.                                     BoxLine = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)TagItem->ti_Data);
  1101.                                 else
  1102.                                     Handle->Failed = TRUE;
  1103.                             }
  1104.  
  1105.                             break;
  1106.  
  1107.                         case LABX_Labels:
  1108.  
  1109.                             if(Type == BOX_KIND)
  1110.                             {
  1111.                                 STRPTR    *Labels = (STRPTR *)TagItem->ti_Data;
  1112.                                 LONG     Count    = 0;
  1113.  
  1114.                                 while(Labels[Count])
  1115.                                     Count++;
  1116.  
  1117.                                 if(Node->Lines != Count)
  1118.                                 {
  1119.                                     LTP_Free(Handle,Node->Special.Box.Lines,sizeof(STRPTR) * Node->Lines);
  1120.  
  1121.                                     Node->Special.Box.Lines = NULL;
  1122.                                 }
  1123.  
  1124.                                 if(Count)
  1125.                                 {
  1126.                                     if(!Node->Special.Box.Lines)
  1127.                                     {
  1128.                                         if(Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count))
  1129.                                         {
  1130.                                             LONG i;
  1131.  
  1132.                                             for(i = 0 ; i < Count ; i++)
  1133.                                                 Node->Special.Box.Lines[i] = "";
  1134.                                         }
  1135.                                     }
  1136.                                 }
  1137.  
  1138.                                 Node->Lines = Count;
  1139.  
  1140.                                 Node->Special.Box.Labels = Labels;
  1141.                             }
  1142.  
  1143.                             break;
  1144.  
  1145.                         case LABX_Lines:
  1146.  
  1147.                             if(Type == BOX_KIND)
  1148.                             {
  1149.                                 STRPTR    *Lines = (STRPTR *)TagItem->ti_Data;
  1150.                                 LONG     Count = 0;
  1151.  
  1152.                                 while(Lines[Count])
  1153.                                     Count++;
  1154.  
  1155.                                 if(Node->Lines && Count > Node->Lines)
  1156.                                     Count = Node->Lines;
  1157.  
  1158.                                 if(Count)
  1159.                                 {
  1160.                                     if(!Node->Special.Box.Lines)
  1161.                                         Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count);
  1162.  
  1163.                                     if(Node->Special.Box.Lines)
  1164.                                     {
  1165.                                         LONG i;
  1166.  
  1167.                                         for(i = 0 ; i < Count ; i++)
  1168.                                             Node->Special.Box.Lines[i] = Lines[i];
  1169.                                     }
  1170.                                 }
  1171.  
  1172.                                 Node->Lines = Count;
  1173.                             }
  1174.  
  1175.                             break;
  1176.  
  1177.                         case LABX_LineTable:
  1178.  
  1179.                             if(Type == BOX_KIND)
  1180.                                 LineTable = (LONG *)TagItem->ti_Data;
  1181.  
  1182.                             break;
  1183.  
  1184.                         case LABX_FirstLine:
  1185.  
  1186.                             if(Type == BOX_KIND)
  1187.                                 FirstLine = TagItem->ti_Data;
  1188.  
  1189.                             break;
  1190.  
  1191.                         case LABX_LastLine:
  1192.  
  1193.                             if(Type == BOX_KIND)
  1194.                                 LastLine = TagItem->ti_Data;
  1195.  
  1196.                             break;
  1197.  
  1198.                         case GA_Disabled:
  1199.  
  1200.                             Node->Disabled = TagItem->ti_Data;
  1201.                             break;
  1202.  
  1203.                         case GTCB_Checked:
  1204.  
  1205.                             if(Type == CHECKBOX_KIND)
  1206.                                 Node->Current = TagItem->ti_Data;
  1207.  
  1208.                             break;
  1209.  
  1210.                         case GTLV_Labels:
  1211.  
  1212.                             if(Type == LISTVIEW_KIND)
  1213.                             {
  1214.                                 if(TagItem->ti_Data)
  1215.                                     Node->Special.List.Labels = (struct List *)TagItem->ti_Data;
  1216.                                 else
  1217.                                     Node->Special.List.Labels = (struct List *)<P_EmptyList;
  1218.                             }
  1219.  
  1220.                             break;
  1221.  
  1222.                         case GTLV_ReadOnly:
  1223.  
  1224.                             if(Type == LISTVIEW_KIND)
  1225.                                 Node->Special.List.ReadOnly = TagItem->ti_Data;
  1226.  
  1227.                             break;
  1228.  
  1229.                         case GTLV_Selected:
  1230.                         case LALV_Selected:
  1231.  
  1232.                             if(Type == LISTVIEW_KIND)
  1233.                                 Node->Current = (LONG)TagItem->ti_Data;
  1234.  
  1235.                             break;
  1236.  
  1237.                         case GTLV_CallBack:
  1238.  
  1239.                             if(Type == LISTVIEW_KIND)
  1240.                                 Node->Special.List.CallBack = (struct Hook *)TagItem->ti_Data;
  1241.  
  1242.                             break;
  1243.  
  1244.                         case GTLV_MaxPen:
  1245.  
  1246.                             if(Type == LISTVIEW_KIND)
  1247.                                 Node->Special.List.MaxPen = TagItem->ti_Data;
  1248.  
  1249.                             break;
  1250.  
  1251.                         case GTMX_Labels:
  1252.  
  1253.                             if(Type == MX_KIND)
  1254.                                 Node->Special.Radio.Choices = (STRPTR *)TagItem->ti_Data;
  1255.  
  1256.                             break;
  1257.  
  1258.                         case GTMX_Active:
  1259.  
  1260.                             if(Type == MX_KIND)
  1261.                                 Node->Current = TagItem->ti_Data;
  1262.  
  1263.                             break;
  1264.  
  1265.                         case GTMX_TitlePlace:
  1266.  
  1267.                             if(Type == MX_KIND && Label)
  1268.                             {
  1269.                                 if(TagItem->ti_Data == PLACE_RIGHT)
  1270.                                     Node->Special.Radio.TitlePlace = PLACETEXT_RIGHT;
  1271.                                 else
  1272.                                     Node->Special.Radio.TitlePlace = PLACETEXT_LEFT;
  1273.                             }
  1274.  
  1275.                             break;
  1276.  
  1277.                         case GTTX_Text:
  1278.  
  1279.                             if(Type == TEXT_KIND)
  1280.                                 Node->Special.Text.Text = (STRPTR)TagItem->ti_Data;
  1281.  
  1282.                             break;
  1283.  
  1284.                         case GTTX_FrontPen:
  1285.  
  1286.                             if(Type == TEXT_KIND)
  1287.                                 Node->Special.Text.FrontPen = (WORD)TagItem->ti_Data;
  1288.  
  1289.                             if(Type == NUMBER_KIND)
  1290.                                 Node->Special.Number.FrontPen = (WORD)TagItem->ti_Data;
  1291.  
  1292.                             break;
  1293.  
  1294.                         case GTTX_BackPen:
  1295.  
  1296.                             if(Type == TEXT_KIND)
  1297.                                 Node->Special.Text.BackPen = (WORD)TagItem->ti_Data;
  1298.  
  1299.                             if(Type == NUMBER_KIND)
  1300.                                 Node->Special.Number.BackPen = (WORD)TagItem->ti_Data;
  1301.  
  1302.                             break;
  1303.  
  1304.                         case GTTX_CopyText:
  1305.  
  1306.                             if(Type == TEXT_KIND)
  1307.                                 Node->Special.Text.CopyText = TagItem->ti_Data;
  1308.  
  1309.                             break;
  1310.  
  1311.                         case GTTX_Border:
  1312.  
  1313.                             if(Type == TEXT_KIND)
  1314.                                 Node->Special.Text.Border = TagItem->ti_Data;
  1315.  
  1316.                             break;
  1317.  
  1318.                         case GTNM_Number:
  1319.  
  1320.                             if(Type == NUMBER_KIND)
  1321.                                 Node->Special.Number.Number = TagItem->ti_Data;
  1322.  
  1323.                             break;
  1324.  
  1325.                         case GTNM_MaxNumberLen:
  1326.  
  1327.                             if(Type == NUMBER_KIND)
  1328.                                 Node->Special.Number.MaxNumberLen = TagItem->ti_Data;
  1329.  
  1330.                             break;
  1331.  
  1332.                         case GTNM_Format:
  1333.  
  1334.                             if(Type == NUMBER_KIND)
  1335.                                 Node->Special.Number.Format = (STRPTR)TagItem->ti_Data;
  1336.  
  1337.                             break;
  1338.  
  1339.                         case GTNM_Border:
  1340.  
  1341.                             if(Type == NUMBER_KIND)
  1342.                                 Node->Special.Number.Border = TagItem->ti_Data;
  1343.  
  1344.                             break;
  1345.  
  1346.                         case GTTX_Justification:
  1347.  
  1348.                             if(Type == NUMBER_KIND)
  1349.                                 Node->Special.Number.Justification = TagItem->ti_Data;
  1350.  
  1351.                             if(Type == TEXT_KIND)
  1352.                                 Node->Special.Text.Justification = TagItem->ti_Data;
  1353.  
  1354.                             break;
  1355.  
  1356.                         case LAPU_CentreActive:
  1357.  
  1358.                             if(Type == POPUP_KIND)
  1359.                                 Node->Special.Popup.CentreActive = TagItem->ti_Data;
  1360.  
  1361.                             break;
  1362.  
  1363.                         case GTCY_Labels:
  1364.  
  1365.                             if(Type == CYCLE_KIND)
  1366.                                 Node->Special.Cycle.Choices = (STRPTR *)TagItem->ti_Data;
  1367.  
  1368. #if defined(DO_POPUP_KIND) && defined(DO_BOOPSI_KIND)
  1369.                             if(Type == POPUP_KIND)
  1370.                                 Node->Special.Popup.Choices = (STRPTR *)TagItem->ti_Data;
  1371. #endif
  1372.  
  1373. #if defined(DO_TAB_KIND) && defined(DO_BOOPSI_KIND)
  1374.                             if(Type == TAB_KIND)
  1375.                                 Node->Special.Tab.Choices = (STRPTR *)TagItem->ti_Data;
  1376. #endif
  1377.  
  1378.                             break;
  1379.  
  1380.                         case GTCY_Active:
  1381.  
  1382.                             if(Type == CYCLE_KIND)
  1383.                                 Node->Current = TagItem->ti_Data;
  1384.  
  1385. #if defined(DO_POPUP_KIND) && defined(DO_BOOPSI_KIND)
  1386.                             if(Type == POPUP_KIND)
  1387.                                 Node->Current = TagItem->ti_Data;
  1388. #endif
  1389.  
  1390. #if defined(DO_TAB_KIND) && defined(DO_BOOPSI_KIND)
  1391.                             if(Type == TAB_KIND)
  1392.                                 Node->Current = TagItem->ti_Data;
  1393. #endif
  1394.  
  1395.                             break;
  1396.  
  1397.                         case GTPA_Depth:
  1398.  
  1399.                             if(Type == PALETTE_KIND)
  1400.                             {
  1401.                                 Node->Special.Palette.Depth = TagItem->ti_Data;
  1402.  
  1403.                                 if(Handle->MaxPen < (1L << Node->Special.Palette.Depth) - 1)
  1404.                                     Handle->MaxPen = (1L << Node->Special.Palette.Depth) - 1;
  1405.                             }
  1406.  
  1407.                             break;
  1408.  
  1409.                         case GTPA_Color:
  1410.  
  1411.                             if(Type == PALETTE_KIND)
  1412.                                 Node->Current = TagItem->ti_Data;
  1413.  
  1414.                             break;
  1415.  
  1416.                         case GTPA_ColorOffset:
  1417.  
  1418.                             if(Type == PALETTE_KIND)
  1419.                                 Node->Min = TagItem->ti_Data;
  1420.  
  1421.                             break;
  1422.  
  1423.                         case GTPA_NumColors:
  1424.  
  1425.                             if(Type == PALETTE_KIND)
  1426.                             {
  1427.                                 Node->Special.Palette.NumColours = TagItem->ti_Data;
  1428.  
  1429.                                 if(Node->Special.Palette.ColourTable)
  1430.                                 {
  1431.                                     LONG i;
  1432.  
  1433.                                     for(i = 0 ; i < Node->Special.Palette.NumColours ; i++)
  1434.                                     {
  1435.                                         if(Node->Special.Palette.ColourTable[i] > Handle->MaxPen)
  1436.                                             Handle->MaxPen = Node->Special.Palette.ColourTable[i];
  1437.                                     }
  1438.                                 }
  1439.                             }
  1440.  
  1441.                             break;
  1442.  
  1443.                         case GTPA_ColorTable:
  1444.  
  1445.                             if(Type == PALETTE_KIND)
  1446.                             {
  1447.                                 Node->Special.Palette.ColourTable = (UBYTE *)TagItem->ti_Data;
  1448.  
  1449.                                 if(Node->Special.Palette.NumColours)
  1450.                                 {
  1451.                                     LONG i;
  1452.  
  1453.                                     for(i = 0 ; i < Node->Special.Palette.NumColours ; i++)
  1454.                                     {
  1455.                                         if(Node->Special.Palette.ColourTable[i] > Handle->MaxPen)
  1456.                                             Handle->MaxPen = Node->Special.Palette.ColourTable[i];
  1457.                                     }
  1458.                                 }
  1459.                             }
  1460.  
  1461.                             break;
  1462.  
  1463.                         case GA_RelVerify:
  1464.  
  1465.                             if(Type == SCROLLER_KIND)
  1466.                                 Node->Special.Scroller.RelVerify = TagItem->ti_Data;
  1467.  
  1468.                             break;
  1469.  
  1470.                         case GA_Immediate:
  1471.  
  1472.                             if(Type == SCROLLER_KIND)
  1473.                                 Node->Special.Scroller.Immediate = TagItem->ti_Data;
  1474.  
  1475.                             break;
  1476.  
  1477.                         case GTSC_Top:
  1478.  
  1479.                             if(Type == SCROLLER_KIND)
  1480.                                 Node->Current = TagItem->ti_Data;
  1481.  
  1482.                             break;
  1483.  
  1484.                         case GTSC_Total:
  1485.  
  1486.                             if(Type == SCROLLER_KIND)
  1487.                                 Node->Max = TagItem->ti_Data;
  1488.  
  1489.                             break;
  1490.  
  1491.                         case GTSC_Visible:
  1492.  
  1493.                             if(Type == SCROLLER_KIND)
  1494.                                 Node->Special.Scroller.Visible = TagItem->ti_Data;
  1495.  
  1496.                             break;
  1497.  
  1498.                         case GTSC_Arrows:
  1499.  
  1500.                             if(Type == SCROLLER_KIND)
  1501.                                 Node->Special.Scroller.Arrows = (TagItem->ti_Data != 0);
  1502.  
  1503.                             break;
  1504.  
  1505.                         case LASC_Thin:
  1506.  
  1507.                             if(Type == SCROLLER_KIND)
  1508.                                 Node->Special.Scroller.Thin = TagItem->ti_Data;
  1509.  
  1510.                             break;
  1511.  
  1512.                         case PGA_Freedom:
  1513.  
  1514.                             if(Type == SCROLLER_KIND)
  1515.                                 Node->Special.Scroller.Vertical = (TagItem->ti_Data == LORIENT_VERT);
  1516.  
  1517.                             break;
  1518.  
  1519.                         case GTSL_Min:
  1520.  
  1521.                             if(Type == SLIDER_KIND || Type == LEVEL_KIND)
  1522.                                 Node->Min = TagItem->ti_Data;
  1523.  
  1524.                             break;
  1525.  
  1526.                         case GTSL_Max:
  1527.  
  1528.                             if(Type == SLIDER_KIND || Type == LEVEL_KIND)
  1529.                                 Node->Max = TagItem->ti_Data;
  1530.  
  1531.                             break;
  1532.  
  1533.                         case GTSL_Level:
  1534.  
  1535.                             if(Type == SLIDER_KIND || Type == LEVEL_KIND)
  1536.                                 Node->Current = TagItem->ti_Data;
  1537.  
  1538.                             break;
  1539.  
  1540.                         case GTSL_LevelFormat:
  1541.  
  1542. #ifdef DO_LEVEL_KIND
  1543.                             if(Type == LEVEL_KIND)
  1544.                                 Node->Special.Level.LevelFormat = (STRPTR)TagItem->ti_Data;
  1545. #endif    /* DO_LEVEL_KIND */
  1546.  
  1547.                             if(Type == SLIDER_KIND)
  1548.                                 Node->Special.Slider.LevelFormat = (STRPTR)TagItem->ti_Data;
  1549.  
  1550.                             break;
  1551.  
  1552.                         case GTSL_LevelPlace:
  1553.  
  1554. #ifdef DO_LEVEL_KIND
  1555.                             if(Type == LEVEL_KIND)
  1556.                             {
  1557.                                 if(TagItem->ti_Data == PLACE_RIGHT)
  1558.                                     Node->Special.Level.LevelPlace = PLACETEXT_RIGHT;
  1559.                                 else
  1560.                                     Node->Special.Level.LevelPlace = PLACETEXT_LEFT;
  1561.                             }
  1562. #endif    /* DO_LEVEL_KIND */
  1563.  
  1564.                             if(Type == SLIDER_KIND)
  1565.                             {
  1566.                                 if(TagItem->ti_Data == PLACE_RIGHT)
  1567.                                     Node->Special.Slider.LevelPlace = PLACETEXT_RIGHT;
  1568.                                 else
  1569.                                     Node->Special.Slider.LevelPlace = PLACETEXT_LEFT;
  1570.                             }
  1571.  
  1572.                             break;
  1573.  
  1574.                         case GTSL_DispFunc:
  1575.  
  1576. #ifdef DO_LEVEL_KIND
  1577.                             if(Type == LEVEL_KIND)
  1578.                                 Node->Special.Level.DispFunc = (DISPFUNC)TagItem->ti_Data;
  1579. #endif    /* DO_LEVEL_KIND */
  1580.  
  1581.                             if(Type == SLIDER_KIND)
  1582.                                 Node->Special.Slider.DispFunc = (DISPFUNC)TagItem->ti_Data;
  1583.  
  1584.                             break;
  1585.  
  1586.                         case LASL_FullCheck:
  1587.  
  1588.                             if(Type == SLIDER_KIND)
  1589.                                 Node->Special.Slider.FullLevelCheck = TagItem->ti_Data;
  1590.  
  1591. #ifdef DO_LEVEL_KIND
  1592.                             if(Type == LEVEL_KIND)
  1593.                                 Node->Special.Level.FullLevelCheck = TagItem->ti_Data;
  1594. #endif    /* DO_LEVEL_KIND */
  1595.  
  1596.                             break;
  1597.  
  1598.                         case GTST_String:
  1599.  
  1600.                             if(Type == STRING_KIND || Type == PASSWORD_KIND)
  1601.                                 Node->Special.String.String = (STRPTR)TagItem->ti_Data;
  1602.  
  1603.                             break;
  1604.  
  1605.                         case LAST_Activate:
  1606.  
  1607.                             if(Type == STRING_KIND || Type == PASSWORD_KIND)
  1608.                                 Node->Special.String.Activate = TagItem->ti_Data;
  1609.  
  1610.                             if(Type == INTEGER_KIND)
  1611.                                 Node->Special.Integer.Activate = TagItem->ti_Data;
  1612.  
  1613.                             break;
  1614.  
  1615.                         case GTST_MaxChars:
  1616.  
  1617.                             if(Type == STRING_KIND || Type == PASSWORD_KIND)
  1618.                                 Node->Special.String.MaxChars = TagItem->ti_Data;
  1619.  
  1620.                             break;
  1621.  
  1622.                         case GTST_EditHook:
  1623.  
  1624.                             if(Type == STRING_KIND)
  1625.                                 Node->Special.String.EditHook = (struct Hook *)TagItem->ti_Data;
  1626.                             else
  1627.                             {
  1628.                                 if(Type == INTEGER_KIND)
  1629.                                 {
  1630.                                     if(Node->Special.Integer.EditHook = (struct Hook *)TagItem->ti_Data)
  1631.                                         Node->Special.Integer.CustomHook = TRUE;
  1632.                                 }
  1633.                             }
  1634.  
  1635.                             break;
  1636.  
  1637.                         case LAST_ValidateHook:
  1638.  
  1639.                             if(Type == STRING_KIND || Type == PASSWORD_KIND)
  1640.                                 Node->Special.String.ValidateHook = (struct Hook *)TagItem->ti_Data;
  1641.                             else
  1642.                             {
  1643.                                 if(Type == INTEGER_KIND)
  1644.                                     Node->Special.Integer.ValidateHook = (struct Hook *)TagItem->ti_Data;
  1645.                             }
  1646.  
  1647.                             break;
  1648.  
  1649.                         case STRINGA_Justification:
  1650.  
  1651.                             if(Type == STRING_KIND || Type == PASSWORD_KIND)
  1652.                                 Node->Special.String.Justification = TagItem->ti_Data;
  1653.                             else
  1654.                             {
  1655.                                 if(Type == INTEGER_KIND)
  1656.                                     Node->Special.Integer.Justification = TagItem->ti_Data;
  1657.                             }
  1658.  
  1659.                             break;
  1660.  
  1661.                         case LAIN_UseIncrementers:
  1662.  
  1663.                             if(Type == INTEGER_KIND)
  1664.                             {
  1665.                                 if(Node->Special.Integer.UseIncrementers = TagItem->ti_Data)
  1666.                                     Handle->IDCMP |= IDCMP_INTUITICKS;
  1667.                             }
  1668.  
  1669.                             break;
  1670.  
  1671.                         case GTIN_Number:
  1672.  
  1673.                             if(Type == INTEGER_KIND)
  1674.                                 Node->Special.Integer.Number = TagItem->ti_Data;
  1675.  
  1676.                             break;
  1677.  
  1678.                         case GTIN_MaxChars:
  1679.  
  1680.                             if(Type == INTEGER_KIND)
  1681.                                 Node->Special.Integer.MaxChars = TagItem->ti_Data;
  1682.  
  1683.                             break;
  1684.                     }
  1685.                 }
  1686.             }
  1687.  
  1688.             if(Handle->Failed)
  1689.                 return;
  1690.  
  1691.             switch(Type)
  1692.             {
  1693.                 case STRING_KIND:
  1694.                 case INTEGER_KIND:
  1695.  
  1696.                     if(Node->Special.String.MaxHistoryLines)
  1697.                     {
  1698.                         if(!Node->Special.Integer.HistoryHook)
  1699.                         {
  1700.                             struct Hook *Hook;
  1701.  
  1702.                             if(Hook = (struct Hook *)LTP_Alloc(Handle,sizeof(struct Hook) + sizeof(struct MinList)))
  1703.                             {
  1704.                                 struct MinList *List;
  1705.  
  1706.                                 List = Hook->h_Data = (APTR)(Hook + 1);
  1707.  
  1708.                                 NewList((struct List *)List);
  1709.  
  1710.                                 Hook->h_Entry = (HOOKFUNC)LTP_DefaultHistoryHook;
  1711.  
  1712.                                 Node->Special.Integer.HistoryHook = Hook;
  1713.                             }
  1714.                         }
  1715.  
  1716.                         if(Node->Special.Integer.HistoryHook)
  1717.                         {
  1718.                             struct Node    *TextNode;
  1719.                             struct MinList *List;
  1720.  
  1721.                             List = (struct List *)Node->Special.Integer.HistoryHook->h_Data;
  1722.  
  1723.                             Node->Special.Integer.LayoutHandle = Handle;
  1724.                             Node->Special.Integer.NumHistoryLines = 0;
  1725.  
  1726.                             TextNode = (struct Node *)List->mlh_Head;
  1727.  
  1728.                             while(TextNode->ln_Succ)
  1729.                             {
  1730.                                 Node->Special.Integer.NumHistoryLines++;
  1731.  
  1732.                                 TextNode = TextNode->ln_Succ;
  1733.                             }
  1734.                         }
  1735.                     }
  1736.  
  1737.                     break;
  1738.  
  1739. #if defined(DO_BOOPSI_KIND) && defined(DO_TAB_KIND)
  1740.  
  1741.                 case TAB_KIND:
  1742.  
  1743.                     Node->Special.Tab.Parent = Handle->CurrentGroup;
  1744.                     break;
  1745. #endif
  1746.  
  1747. #ifdef DO_BOOPSI_KIND
  1748.                 case BOOPSI_KIND:
  1749.  
  1750.                     Node->Special.BOOPSI.Parent = Handle->CurrentGroup;
  1751.  
  1752.                     if(Node->Special.BOOPSI.ClassTags = CloneTagItems(TagList))
  1753.                     {
  1754.                         STATIC ULONG Exclude[] =
  1755.                         {
  1756.                             LA_Chars,
  1757.                             LA_Lines,
  1758.                             LABO_TagCurrent,
  1759.                             LABO_TagTextAttr,
  1760.                             LABO_TagDrawInfo,
  1761.                             LABO_ClassInstance,
  1762.                             LABO_ClassName,
  1763.                             LABO_ClassLibraryName,
  1764.                             LABO_ExactWidth,
  1765.                             LABO_ExactHeight,
  1766.  
  1767.                             TAG_DONE
  1768.                         };
  1769.  
  1770.                         FilterTagItems(Node->Special.BOOPSI.ClassTags,(Tag *)Exclude,TAGFILTER_NOT);
  1771.                     }
  1772.                     else
  1773.                         Handle->Failed = TRUE;
  1774.  
  1775.                     break;
  1776. #endif    /* DO_BOOPSI_KIND */
  1777.  
  1778.                 case TEXT_KIND:
  1779.  
  1780.                     if(Node->Special.Text.CopyText && Node->Special.Text.Text)
  1781.                     {
  1782.                         STRPTR text;
  1783.  
  1784.                         if(text = LTP_Alloc(Handle,strlen(Node->Special.Text.Text) + 1))
  1785.                         {
  1786.                             strcpy(text,Node->Special.Text.Text);
  1787.  
  1788.                             Node->Special.Text.Text = text;
  1789.                         }
  1790.                     }
  1791.  
  1792.                     break;
  1793.  
  1794.                 case BOX_KIND:
  1795.  
  1796.                     if(FirstLine != -1 && LastLine != -1)
  1797.                     {
  1798.                         if(FirstLine <= LastLine && Handle->LocaleHook)
  1799.                         {
  1800.                             LONG Count = LastLine - FirstLine + 1;
  1801.  
  1802.                             if(Node->Lines && Count > Node->Lines)
  1803.                                 Count = Node->Lines;
  1804.                             else
  1805.                                 Node->Lines = Count;
  1806.  
  1807.                             if(Count)
  1808.                             {
  1809.                                 if(!Node->Special.Box.Lines)
  1810.                                     Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count);
  1811.  
  1812.                                 if(Node->Special.Box.Lines)
  1813.                                 {
  1814.                                     LONG i;
  1815.  
  1816.                                     for(i = 0 ; i < Count ; i++)
  1817.                                         Node->Special.Box.Lines[i] = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(FirstLine + i));
  1818.                                 }
  1819.                             }
  1820.                         }
  1821.                         else
  1822.                             Handle->Failed = TRUE;
  1823.                     }
  1824.                     else
  1825.                     {
  1826.                         if(LineTable)
  1827.                         {
  1828.                             if(Handle->LocaleHook)
  1829.                             {
  1830.                                 LONG Count = 0;
  1831.  
  1832.                                 while(LineTable[Count] != -1)
  1833.                                     Count++;
  1834.  
  1835.                                 if(Node->Lines && Count > Node->Lines)
  1836.                                     Count = Node->Lines;
  1837.                                 else
  1838.                                     Node->Lines = Count;
  1839.  
  1840.                                 if(Count)
  1841.                                 {
  1842.                                     if(!Node->Special.Box.Lines)
  1843.                                         Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count);
  1844.  
  1845.                                     if(Node->Special.Box.Lines)
  1846.                                     {
  1847.                                         LONG i;
  1848.  
  1849.                                         for(i = 0 ; i < Count ; i++)
  1850.                                             Node->Special.Box.Lines[i] = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(LineTable[i]));
  1851.                                     }
  1852.                                 }
  1853.                             }
  1854.                             else
  1855.                                 Handle->Failed = TRUE;
  1856.                         }
  1857.                         else
  1858.                         {
  1859.                             if(BoxLine)
  1860.                             {
  1861.                                 LONG Count,i;
  1862.  
  1863.                                 for(i = 0, Count = 1 ; i < strlen(BoxLine) ; i++)
  1864.                                 {
  1865.                                     if(BoxLine[i] == '\n')
  1866.                                         Count++;
  1867.                                 }
  1868.  
  1869.                                 if(Node->Lines && Count > Node->Lines)
  1870.                                     Count = Node->Lines;
  1871.                                 else
  1872.                                     Node->Lines = Count;
  1873.  
  1874.                                 if(Count)
  1875.                                 {
  1876.                                     if(!Node->Special.Box.Lines)
  1877.                                         Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count);
  1878.  
  1879.                                     if(Node->Special.Box.Lines)
  1880.                                     {
  1881.                                         STRPTR From,To;
  1882.                                         LONG Len;
  1883.  
  1884.                                         From = BoxLine;
  1885.  
  1886.                                         for(i = 0 ; i < Count ; i++)
  1887.                                         {
  1888.                                             for(To = From ; *To ; To++)
  1889.                                             {
  1890.                                                 if(*To == '\n')
  1891.                                                     break;
  1892.                                             }
  1893.  
  1894.                                             Len = (LONG)(To - From);
  1895.  
  1896.                                             if(Node->Special.Box.Lines[i] = LTP_Alloc(Handle,Len + 1))
  1897.                                             {
  1898.                                                 if(Len)
  1899.                                                     CopyMem(From,Node->Special.Box.Lines[i],Len);
  1900.  
  1901.                                                 Node->Special.Box.Lines[i][Len] = 0;
  1902.  
  1903.                                                 From = To + 1;
  1904.                                             }
  1905.                                         }
  1906.                                     }
  1907.                                 }
  1908.                             }
  1909.                         }
  1910.                     }
  1911.  
  1912.                     break;
  1913.             }
  1914.  
  1915.             if((FirstLabel != -1 && LastLabel != -1) || LabelTable)
  1916.             {
  1917.                 if(!Handle->LocaleHook)
  1918.                     Handle->Failed = TRUE;
  1919.                 else
  1920.                 {
  1921.                     if(Type == LISTVIEW_KIND)
  1922.                     {
  1923.                         struct List *SomeList;
  1924.  
  1925.                         if(SomeList = (struct List *)LTP_Alloc(Handle,sizeof(struct MinList)))
  1926.                         {
  1927.                             struct Node    *SomeNode;
  1928.                             LONG         Count = (LastLabel - FirstLabel + 1),i;
  1929.  
  1930.                             NewList(SomeList);
  1931.  
  1932.                             Node->Special.List.Labels = SomeList;
  1933.  
  1934.                             if(LabelTable)
  1935.                             {
  1936.                                 while(*LabelTable != -1)
  1937.                                 {
  1938.                                     if(SomeNode = LTP_Alloc(Handle,sizeof(struct Node)))
  1939.                                     {
  1940.                                         SomeNode->ln_Name = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(*LabelTable++));
  1941.  
  1942.                                         AddTail(SomeList,SomeNode);
  1943.                                     }
  1944.                                 }
  1945.                             }
  1946.                             else
  1947.                             {
  1948.                                 for(i = 0 ; i < Count ; i++)
  1949.                                 {
  1950.                                     if(SomeNode = LTP_Alloc(Handle,sizeof(struct Node)))
  1951.                                     {
  1952.                                         SomeNode->ln_Name = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(FirstLabel + i));
  1953.  
  1954.                                         AddTail(SomeList,SomeNode);
  1955.                                     }
  1956.                                 }
  1957.                             }
  1958.                         }
  1959.                     }
  1960.                     else
  1961.                     {
  1962.                         if(Type == MX_KIND || Type == CYCLE_KIND || Type == POPUP_KIND || Type == TAB_KIND || Type == BOX_KIND || Type == BUTTON_KIND)
  1963.                         {
  1964.                             STRPTR    *Labels;
  1965.                             LONG     Count,i;
  1966.  
  1967.                             if(LabelTable)
  1968.                             {
  1969.                                 LONG *Index = LabelTable;
  1970.  
  1971.                                 for(Count = 0 ; *Index != -1 ; Count++, Index++);
  1972.                             }
  1973.                             else
  1974.                                 Count = (LastLabel - FirstLabel + 1);
  1975.  
  1976.                             if(Labels = LTP_Alloc(Handle,sizeof(STRPTR) * (Count + 1)))
  1977.                             {
  1978.                                 if(LabelTable)
  1979.                                 {
  1980.                                     for(i = 0 ; i < Count ; i++)
  1981.                                         Labels[i] = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(*LabelTable++));
  1982.                                 }
  1983.                                 else
  1984.                                 {
  1985.                                     for(i = 0 ; i < Count ; i++)
  1986.                                         Labels[i] = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)(FirstLabel + i));
  1987.                                 }
  1988.  
  1989.                                 Labels[i] = NULL;
  1990.  
  1991.                                 switch(Type)
  1992.                                 {
  1993.                                     case BUTTON_KIND:
  1994.  
  1995.                                         Node->Special.Button.Lines = Labels;
  1996.                                         break;
  1997.  
  1998.                                     case MX_KIND:
  1999.  
  2000.                                         Node->Special.Radio.Choices = Labels;
  2001.                                         break;
  2002.  
  2003.                                     case CYCLE_KIND:
  2004.  
  2005.                                         Node->Special.Cycle.Choices = Labels;
  2006.                                         break;
  2007.  
  2008. #if defined(DO_POPUP_KIND) && defined(DO_BOOPSI_KIND)
  2009.                                     case POPUP_KIND:
  2010.  
  2011.                                         Node->Special.Popup.Choices = Labels;
  2012.                                         break;
  2013. #endif
  2014.  
  2015. #if defined(DO_TAB_KIND) && defined(DO_BOOPSI_KIND)
  2016.                                     case TAB_KIND:
  2017.  
  2018.                                         Node->Special.Tab.Choices = Labels;
  2019.                                         break;
  2020. #endif
  2021.  
  2022.                                     case BOX_KIND:
  2023.  
  2024.                                         if(!Node->Special.Box.Lines)
  2025.                                         {
  2026.                                             if(Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Count))
  2027.                                             {
  2028.                                                 LONG i;
  2029.  
  2030.                                                 for(i = 0 ; i < Count ; i++)
  2031.                                                     Node->Special.Box.Lines[i] = "";
  2032.                                             }
  2033.                                         }
  2034.  
  2035.                                         Node->Lines = Count;
  2036.  
  2037.                                         Node->Special.Box.Labels = Labels;
  2038.  
  2039.                                         break;
  2040.                                 }
  2041.                             }
  2042.                         }
  2043.                     }
  2044.                 }
  2045.             }
  2046.  
  2047.             switch(Type)
  2048.             {
  2049.                 case BUTTON_KIND:
  2050.  
  2051.                     if(!Node->NoKey && !Node->Special.Button.KeyStroke)
  2052.                     {
  2053.                         ULONG    Len;
  2054.                         STRPTR    Label,*Index = Node->Special.Button.Lines;
  2055.                         BOOL    GotIt = FALSE;
  2056.  
  2057.                         while(!GotIt)
  2058.                         {
  2059.                             if(Index)
  2060.                             {
  2061.                                 if(!(Label = *Index++))
  2062.                                     break;
  2063.                             }
  2064.                             else
  2065.                             {
  2066.                                 Label = Node->Label;
  2067.                                 GotIt = TRUE;
  2068.                             }
  2069.  
  2070.                             Len = 0;
  2071.  
  2072.                             while(Label[Len])
  2073.                             {
  2074.                                 if(Label[Len] == '_' && Label[Len + 1])
  2075.                                 {
  2076.                                     STRPTR NewLabel = LTP_Alloc(Handle,strlen(Label));
  2077.  
  2078.                                     if(NewLabel)
  2079.                                     {
  2080.                                         if(Len)
  2081.                                             CopyMem(Label,NewLabel,Len);
  2082.  
  2083.                                         strcpy(&NewLabel[Len],&Label[Len + 1]);
  2084.  
  2085.                                         Node->Special.Button.KeyStroke = &NewLabel[Len];
  2086.  
  2087.                                         Node->Key = ToLower(NewLabel[Len]);
  2088.  
  2089.                                         if(Index)
  2090.                                             Index[-1] = NewLabel;
  2091.                                         else
  2092.                                             Node->Label = NewLabel;
  2093.                                     }
  2094.  
  2095.                                     GotIt = TRUE;
  2096.  
  2097.                                     break;
  2098.                                 }
  2099.  
  2100.                                 Len++;
  2101.                             }
  2102.                         }
  2103.                     }
  2104.  
  2105.                     break;
  2106.  
  2107.                 case BOX_KIND:
  2108.  
  2109.                     if(Node->Special.Box.ReserveSpace)
  2110.                     {
  2111.                         LONG    Size;
  2112.                         STRPTR    Buffer;
  2113.  
  2114.                         if(!Node->Special.Box.Lines)
  2115.                         {
  2116.                             if(Node->Special.Box.Lines = LTP_Alloc(Handle,sizeof(STRPTR) * Node->Lines))
  2117.                             {
  2118.                                 LONG i;
  2119.  
  2120.                                 for(i = 0 ; i < Node->Lines ; i++)
  2121.                                     Node->Special.Box.Lines[i] = "";
  2122.                             }
  2123.                         }
  2124.  
  2125.                         if(!Node->Chars)
  2126.                             Size = 10;
  2127.                         else
  2128.                             Size = Node->Chars;
  2129.  
  2130.                         Node->Special.Box.MaxSize = Size;
  2131.  
  2132.                         if(Buffer = (STRPTR)LTP_Alloc(Handle,(Size + 1) * Node->Lines))
  2133.                         {
  2134.                             LONG i,Len;
  2135.  
  2136.                             for(i = 0 ; i < Node->Lines ; i++)
  2137.                             {
  2138.                                 if(Node->Special.Box.Lines[i])
  2139.                                 {
  2140.                                     Len = strlen(Node->Special.Box.Lines[i]);
  2141.  
  2142.                                     if(Len > Size)
  2143.                                         Len = Size;
  2144.  
  2145.                                     CopyMem(Node->Special.Box.Lines[i],Buffer,Len);
  2146.  
  2147.                                     Buffer[Len] = 0;
  2148.                                 }
  2149.                                 else
  2150.                                     Buffer[0] = 0;
  2151.  
  2152.                                 Node->Special.Box.Lines[i] = Buffer;
  2153.  
  2154.                                 Buffer += Size + 1;
  2155.                             }
  2156.                         }
  2157.                     }
  2158.  
  2159.                     break;
  2160.  
  2161.                 case XBAR_KIND:
  2162.                 case YBAR_KIND:
  2163.  
  2164.                     Node->Special.Bar.Parent = Handle->CurrentGroup;
  2165.                     break;
  2166.  
  2167. #ifdef DO_PASSWORD_KIND
  2168.  
  2169.                 case PASSWORD_KIND:
  2170.                 {
  2171.                     STRPTR Buffer;
  2172.  
  2173.                     if(Buffer = LTP_Alloc(Handle,2 * (Node->Special.String.MaxChars + 1)))
  2174.                     {
  2175.                         Node->Special.String.RealString    = Buffer;
  2176.                         Node->Special.String.Original    = Buffer + Node->Special.String.MaxChars + 1;
  2177.  
  2178.                         if(Node->Special.String.String)
  2179.                         {
  2180.                             strcpy(Node->Special.String.RealString,Node->Special.String.String);
  2181.                             strcpy(Node->Special.String.Original,Node->Special.String.String);
  2182.                         }
  2183.                     }
  2184.  
  2185.                     break;
  2186.                 }
  2187. #endif
  2188.             }
  2189.  
  2190.             if(ParentList)
  2191.                 AddTail((struct List *)ParentList,(struct Node *)Node);
  2192.         }
  2193.     }
  2194. }
  2195.  
  2196.  
  2197. /*****************************************************************************/
  2198.  
  2199.  
  2200. /****** gtlayout.library/LT_NewA ******************************************
  2201. *
  2202. *   NAME
  2203. *    LT_NewA -- Add a new object to the user interface tree.
  2204. *
  2205. *   SYNOPSIS
  2206. *    LT_NewA(Handle,Tags);
  2207. *             A0    A1
  2208. *
  2209. *    VOID LT_NewA(LayoutHandle *,struct TagItem *);
  2210. *
  2211. *    LT_New(Handle,...);
  2212. *
  2213. *    VOID LT_New(LayoutHandle *,...);
  2214. *
  2215. *   FUNCTION
  2216. *    LT_NewA() is the routine you use to build the user interface,
  2217. *    you give layout directions, design groups, etc. and finally
  2218. *    call LT_BuildA() to turn these specifications into a window.
  2219. *
  2220. *   INPUTS
  2221. *    Handle - Pointer to LayoutHandle structure.
  2222. *
  2223. *
  2224. *    This routine will accept almost all create-time tag items
  2225. *    gadtools.library/CreateGadget will handle. In addition to
  2226. *    this there are a bunch of extra gadget objects and extra
  2227. *    tag items supported:
  2228. *
  2229. *    All object types:
  2230. *
  2231. *        LA_Type (LONG) - Type of the object to create, must be
  2232. *            one of the following:
  2233. *
  2234. *                TEXT_KIND
  2235. *                VERTICAL_KIND
  2236. *                HORIZONTAL_KIND
  2237. *                END_KIND
  2238. *                FRAME_KIND
  2239. *                BOX_KIND
  2240. *                SLIDER_KIND
  2241. *                LISTVIEW_KIND
  2242. *                INTEGER_KIND
  2243. *                STRING_KIND
  2244. *                PASSWORD_KIND
  2245. *                PALETTE_KIND
  2246. *                BUTTON_KIND
  2247. *                CHECKBOX_KIND
  2248. *                NUMBER_KIND
  2249. *                GAUGE_KIND
  2250. *                CYCLE_KIND
  2251. *                POPUP_KIND
  2252. *                TAB_KIND
  2253. *                MX_KIND
  2254. *                XBAR_KIND
  2255. *                YBAR_KIND
  2256. *                TAPEDECK_KIND
  2257. *                LEVEL_KIND
  2258. *                BOOPSI_KIND
  2259. *                BLANK_KIND (V36)
  2260. *
  2261. *        LA_LabelText (STRPTR) - The object label text to use.
  2262. *
  2263. *        LA_LabelID (LONG) - The locale text ID of the string to
  2264. *            use as the object label text.
  2265. *
  2266. *                NOTE: LT_NewA() will fail if you forget
  2267. *                    to select a hook with LAHN_LocaleHook
  2268. *                    at LT_CreateHandleTagList.
  2269. *
  2270. *        LA_ID (LONG) - The gadget ID to use for this object.
  2271. *
  2272. *                NOTE: User ID values *MUST* be greater than 0,
  2273. *                      negative values are reserved for internal
  2274. *                      use.
  2275. *
  2276. *        LA_Chars (LONG) - The width of this object measured in
  2277. *            characters. If each character of the user interface
  2278. *            font is 8 pixels wide an object with LA_Chars set to
  2279. *            10 will usually be 80 pixels wide.
  2280. *
  2281. *        LA_LabelChars (LONG) - This forces the internal gadget
  2282. *            label width the layout engine calculates during the
  2283. *            layout pass to a specific value. Note: this does
  2284. *            not work well with all objects. (V9)
  2285. *
  2286. *        LA_LabelPlace (LONG) - Where to place the gadget label.
  2287. *            Not all objects will support all label positions:
  2288. *
  2289. *                PLACE_LEFT - Place label text left of object
  2290. *                PLACE_RIGHT - Place label text right of object
  2291. *                PLACE_ABOVE - Place label text above object
  2292. *                PLACE_IN - Place label text in object
  2293. *                PLACE_BELOW - Place label text below object
  2294. *
  2295. *        LA_ExtraSpace (BOOL) - Add extra vertical/horizontal
  2296. *            space before this object.
  2297. *            Default: FALSE
  2298. *
  2299. *        LA_ExtraFat (BOOL) - Make this object a bit larger
  2300. *            than its usual size.
  2301. *            Default: FALSE
  2302. *
  2303. *        LA_NoKey (BOOL) - Don't let the user interface choose
  2304. *            a keyboard shortcut for this object.
  2305. *            Default: FALSE
  2306. *
  2307. *        LA_HighLabel (BOOL) - Use highlight pen when rendering
  2308. *            the gadget label text.
  2309. *            Default: FALSE
  2310. *
  2311. *        LA_BYTE (BYTE *) - Pointer to the variable that holds
  2312. *            the "current value" of the object. The layout engine
  2313. *            will retrieve this value initially during the creation
  2314. *            of the object and maintain it during its lifespan.
  2315. *            This means you do not need to worry about checking
  2316. *            the state of the object, the user interface layout
  2317. *            engine will do it for you.
  2318. *
  2319. *        LA_UBYTE (UBYTE *) - Pointer to the variable that holds
  2320. *            the "current value" of the object. The layout engine
  2321. *            will retrieve this value initially during the creation
  2322. *            of the object and maintain it during its lifespan.
  2323. *            This means you do not need to worry about checking
  2324. *            the state of the object, the user interface layout
  2325. *            engine will do it for you.
  2326. *
  2327. *        LA_WORD (WORD *) - Pointer to the variable that holds
  2328. *            the "current value" of the object. The layout engine
  2329. *            will retrieve this value initially during the creation
  2330. *            of the object and maintain it during its lifespan.
  2331. *            This means you do not need to worry about checking
  2332. *            the state of the object, the user interface layout
  2333. *            engine will do it for you.
  2334. *
  2335. *        LA_UWORD (UWORD *) - Pointer to the variable that holds
  2336. *            the "current value" of the object. The layout engine
  2337. *            will retrieve this value initially during the creation
  2338. *            of the object and maintain it during its lifespan.
  2339. *            This means you do not need to worry about checking
  2340. *            the state of the object, the user interface layout
  2341. *            engine will do it for you.
  2342. *
  2343. *        LA_BOOL (BOOL *) - Pointer to the variable that holds
  2344. *            the "current value" of the object. The layout engine
  2345. *            will retrieve this value initially during the creation
  2346. *            of the object and maintain it during its lifespan.
  2347. *            This means you do not need to worry about checking
  2348. *            the state of the object, the user interface layout
  2349. *            engine will do it for you.
  2350. *
  2351. *        LA_LONG (LONG *) - Pointer to the variable that holds
  2352. *            the "current value" of the object. The layout engine
  2353. *            will retrieve this value initially during the creation
  2354. *            of the object and maintain it during its lifespan.
  2355. *            This means you do not need to worry about checking
  2356. *            the state of the object, the user interface layout
  2357. *            engine will do it for you.
  2358. *
  2359. *        LA_ULONG (ULONG *) - Pointer to the variable that holds
  2360. *            the "current value" of the object. The layout engine
  2361. *            will retrieve this value initially during the creation
  2362. *            of the object and maintain it during its lifespan.
  2363. *            This means you do not need to worry about checking
  2364. *            the state of the object, the user interface layout
  2365. *            engine will do it for you.
  2366. *
  2367. *        LA_STRPTR (STRPTR) - Pointer to the variable that holds
  2368. *            the "current value" of the object. The layout engine
  2369. *            will retrieve this value initially during the creation
  2370. *            of the object and maintain it during its lifespan.
  2371. *            This means you do not need to worry about checking
  2372. *            the state of the object, the user interface layout
  2373. *            engine will do it for you.
  2374. *
  2375. *        LA_FRACTION (FRACTION *) - Pointer to the variable that holds
  2376. *            the "current value" of the object. The layout engine
  2377. *            will retrieve this value initially during the creation
  2378. *            of the object and maintain it during its lifespan.
  2379. *            This means you do not need to worry about checking
  2380. *            the state of the object, the user interface layout
  2381. *            engine will do it for you.
  2382. *
  2383. *
  2384. *        TEXT_KIND:
  2385. *
  2386. *            LATX_Picker (BOOL) - Attach a `select' button to the
  2387. *                right hand side of the text display.
  2388. *                Default: FALSE
  2389. *
  2390. *            LATX_LockSize (BOOL) - After doing the initial layout
  2391. *                for this object, do not adapt its size again during
  2392. *                subsequent layouts. This is particularly useful if
  2393. *                you have a TEXT_KIND object in a paged group
  2394. *                and update its contents later. You need
  2395. *                to specify an object width using LA_Chars, otherwise
  2396. *                the layout engine may make it not wide enough to
  2397. *                display any text. (V15)
  2398. *
  2399. *
  2400. *        VERTICAL_KIND (group to align objects vertically):
  2401. *        HORIZONTAL_KIND (group to align objects horizontally):
  2402. *
  2403. *            LAGR_Spread (BOOL) - Place all objects in this
  2404. *                group with roughly the same amount of space
  2405. *                between them.
  2406. *                Default: FALSE
  2407. *
  2408. *            LAGR_SameSize (BOOL) - Make all objects in this
  2409. *                group the same size (for vertical groups:
  2410. *                the same height, for horizontal groups:
  2411. *                the same width).
  2412. *                Default: FALSE
  2413. *
  2414. *            LAGR_LastAttributes (BOOL) - Try to copy the
  2415. *                size of the previous group for this new
  2416. *                group. May not work if this group turns
  2417. *                out to be larger than the previous group.
  2418. *                Default: FALSE
  2419. *
  2420. *            LAGR_ActivePage (LONG) - Organize all child
  2421. *                groups as pages which can be flipped through
  2422. *                using LT_SetAttributes(). You need to
  2423. *                specify the number of the first page to
  2424. *                display, starting from 0.
  2425. *
  2426. *                    NOTE: Specifying this tag actually enables
  2427. *                        the paging feature. If you omit this
  2428. *                        tag calls to flip to a specific
  2429. *                        page will fail.
  2430. *
  2431. *                Default: No paging
  2432. *
  2433. *            LAGR_Frame (BOOL) - Draw a recessed frame around
  2434. *                this group, even if there is no group label. (V7)
  2435. *
  2436. *            LAGR_IndentX (BOOL) - Add extra horizontal indentation
  2437. *                for this group. (V10)
  2438. *
  2439. *            LAGR_IndentY (BOOL) - Add extra vertical indentation
  2440. *                for this group. (V10)
  2441. *
  2442. *            LAGR_NoIndent (BOOL) - Inhibit automatic size adjustion
  2443. *                and centring of this group if it is smaller than
  2444. *                the neighbouring groups. (V21)
  2445. *
  2446. *            LAGR_SameWidth (WORD) - During the final layout pass,
  2447. *                make this group the same width as the group which
  2448. *                uses the given ID. Not implemented yet. (V25)
  2449. *
  2450. *            LAGR_SameHeight (WORD) - During the final layout pass,
  2451. *                make this group the same height as the group which
  2452. *                uses the given ID. Not implemented yet. (V25)
  2453. *
  2454. *
  2455. *        FRAME_KIND (fixed size general purpose display,
  2456. *            you may render into it):
  2457. *
  2458. *            LAFR_InnerWidth (LONG) - Inner width of the
  2459. *                display box.
  2460. *
  2461. *            LAFR_InnerHeight (LONG) - Inner height of the
  2462. *                display box.
  2463. *
  2464. *            LAFR_DrawBox (BOOL) - Draw a recessed bevel box
  2465. *                around the display box.
  2466. *                Default: FALSE
  2467. *
  2468. *            LAFR_RefreshHook (struct Hook *) - Hook to call
  2469. *                when refreshing/redrawing this object. See
  2470. *                gtlayout.h for more information. (V9)
  2471. *
  2472. *            LAFR_GenerateEvents (BOOL) - If TRUE, clicking
  2473. *                inside the FRAME_KIND object will generate
  2474. *                IDCMP_GADGETUP/IDCMP_GADGETDOWN events. If
  2475. *                you wish to know where the click occured,
  2476. *                make a copy of the Window->MouseX/Y entries
  2477. *                before you call LT_HandleInput()/LT_GetIMsg(). (V28)
  2478. *                Default: FALSE
  2479. *
  2480. *
  2481. *        XBAR_KIND (horizontal separator bar):
  2482. *
  2483. *            LAXB_FullSize (BOOL) - Make this separator bar span
  2484. *                the entire window width.
  2485. *
  2486. *        BLANK_KIND (transparent placeholder):
  2487. *
  2488. *            No tags are defined for this type of object (V36).
  2489. *
  2490. *        BOX_KIND (multiline text display):
  2491. *
  2492. *            LABX_Labels (STRPTR *) - The label texts to display
  2493. *                on the right hand side of the box. Terminate
  2494. *                this array with NULL.
  2495. *
  2496. *            LABX_Lines (STRPTR *) - The text to display in the
  2497. *                box. Terminate this array with NULL.
  2498. *
  2499. *            LABX_Rows (LONG) - The width of this object in
  2500. *                characters. The layout routine will try to make
  2501. *                sure that the given number of characters will
  2502. *                fit into a single line of text in this box.
  2503. *                This may be a problem with proportional spaced
  2504. *                fonts.
  2505. *
  2506. *            LABX_AlignText (LONG) - Controls how text is aligned
  2507. *                in box lines:
  2508. *
  2509. *                    ALIGNTEXT_LEFT - Align text to the left edge
  2510. *                    ALIGNTEXT_CENTERED - Centre the text
  2511. *                    ALIGNTEXT_RIGHT - Align text to the right edge
  2512. *                    ALIGNTEXT_PAD - Pad text lines
  2513. *
  2514. *                Default: ALIGNTEXT_LEFT
  2515. *
  2516. *            LABX_DrawBox (BOOL) - Draw a recessed bevel box
  2517. *                around the text box.
  2518. *                Default: FALSE
  2519. *
  2520. *            LABX_FirstLabel (LONG) - Locale string ID of the first
  2521. *                text to use as a box label. Works in conjunction
  2522. *                with LABX_LastLabel.
  2523. *
  2524. *            LABX_LastLabel (LONG) - Locale string ID of the last
  2525. *                text to use as a box label. Works in conjunction
  2526. *                with LABX_FirstLabel. When building the interface the
  2527. *                code will loop from FirstLabel..LastLabel, look
  2528. *                up the corresponding locale strings and use the
  2529. *                data to make up the label text to appear at the
  2530. *                right hand side of the box.
  2531. *
  2532. *            LABX_LabelTable (LONG *) - Pointer to an array of IDs
  2533. *                to use for building the box labels. This requires
  2534. *                that a locale hook is provided with the layout handle.
  2535. *                The array is terminated by -1.
  2536. *
  2537. *            LABX_ReserveSpace (BOOL) - Allocate extra memory to hold
  2538. *                the contents of the lines displayed. This avoids nasty
  2539. *                side-effects when refreshing this object.
  2540. *                Default: FALSE
  2541. *
  2542. *            LABX_FirstLine (LONG) - Locale string ID of the first
  2543. *                text to print inside the box. Works in conjunction
  2544. *                with LABX_LastLine. (V26)
  2545. *
  2546. *            LABX_LastLine (LONG) - Locale string ID of the last
  2547. *                text to print inside the box. Works in conjunction
  2548. *                with LABX_FirstLine. (V26)
  2549. *
  2550. *            LABX_LineTable (LONG *) - Pointer to an array of IDs
  2551. *                to use for building the box contents lines. This requires
  2552. *                that a locale hook is provided with the layout handle.
  2553. *                The array is terminated by -1. (V28)
  2554. *
  2555. *            LABX_Line (STRPTR) - Line to display in the box, may
  2556. *                contain '\n' line break characters, the layout engine
  2557. *                will chop the single line into single consecutive lines
  2558. *                following the '\n' chars. (V31)
  2559. *
  2560. *            LABX_LineID (LONG) - Locale ID of line text to display in the
  2561. *                box, may contain '\n' line break characters, the layout
  2562. *                engine will chop the single line into single consecutive lines
  2563. *                following the '\n' chars. (V31)
  2564. *
  2565. *        SLIDER_KIND:
  2566. *
  2567. *            LASL_FullCheck: TRUE will cause the code to rattle
  2568. *                through all possible slider settings, starting
  2569. *                from the minimum value, ending at the maximum value.
  2570. *                While this may be a good idea for a display
  2571. *                function to map slider levels to text strings
  2572. *                of varying length it might be a problem when
  2573. *                it comes to display a range of numbers from
  2574. *                1 to 40,000: the code will loop through
  2575. *                40,000 iterations trying to find the longest
  2576. *                string.
  2577. *
  2578. *                FALSE will cause the code to calculate the
  2579. *                longest level string based only on the
  2580. *                minimum and the maximum value to check.
  2581. *                While this is certainly a good a idea when
  2582. *                it comes to display a range of numbers from
  2583. *                1 to 40,000 as only two values will be
  2584. *                checked the code may fail to produce
  2585. *                accurate results for sliders using display
  2586. *                functions mapping slider levels to strings.
  2587. *
  2588. *                Default: TRUE
  2589. *
  2590. *
  2591. *        LEVEL_KIND:
  2592. *
  2593. *            All tags are supported which SLIDER_KIND supports.
  2594. *            The gadget level display however, can only be aligned
  2595. *            to the left border.
  2596. *
  2597. *
  2598. *        LISTVIEW_KIND:
  2599. *
  2600. *            LALV_ExtraLabels (STRPTR *) - Place extra line
  2601. *                labels at the right of the box. Terminate
  2602. *                this array with NULL.
  2603. *
  2604. *            LALV_Labels (STRPTR *) - The labels to display
  2605. *                inside the box, you can pass this array of
  2606. *                strings in rather than passing an initialized
  2607. *                List of text via GTLV_Labels. Terminate
  2608. *                this array with NULL.
  2609. *
  2610. *            LALV_CursorKey (BOOL) - Let the user operate this
  2611. *                listview using the cursor keys.
  2612. *
  2613. *                    NOTE: there can be only one single listview
  2614. *                        per window to sport this feature.
  2615. *
  2616. *                Default: FALSE
  2617. *
  2618. *            LALV_Lines (LONG) - The number of text lines this
  2619. *                listview is to display.
  2620. *
  2621. *            LALV_Link (LONG) - The Gadget ID of a string gadget
  2622. *                to attach to this listview.
  2623. *
  2624. *                    NOTE: you need to
  2625. *                        add the Gadget in question before you add the
  2626. *                        listview to refer to it or the layout routine
  2627. *                        will get confused.
  2628. *
  2629. *                Passing the value NIL_LINK will create a listview
  2630. *                which displays the currently selected item, otherwise
  2631. *                you will get a read-only list.
  2632. *
  2633. *            LALV_FirstLabel (LONG) - Locale string ID of the first
  2634. *                text to use as a list label. Works in conjunction
  2635. *                with LALV_LastLabel.
  2636. *
  2637. *            LALV_LastLabel (LONG) - Locale string ID of the last
  2638. *                text to use as a list label. Works in conjunction
  2639. *                with LALV_FirstLabel. When building the interface the
  2640. *                code will loop from FirstLabel..LastLabel, look
  2641. *                up the corresponding locale strings and use the
  2642. *                data to make up the label text to appear in the
  2643. *                list.
  2644. *
  2645. *            LALV_LabelTable (LONG *) - Pointer to an array of IDs
  2646. *                to use for building the listview contents. This requires
  2647. *                that a locale hook is provided with the layout handle.
  2648. *                The array is terminated by -1.
  2649. *
  2650. *            LALV_MaxGrowX (LONG) - Maximum width of this object
  2651. *                measured in characters. When the first layout pass
  2652. *                is finished and there is still enough space left
  2653. *                to make the listview wider, the width is increased
  2654. *                until it hits the limit specified using this tag.
  2655. *
  2656. *                    NOTE: there can be only one single listview
  2657. *                        per window to sport this feature.
  2658. *
  2659. *                Default: 0
  2660. *
  2661. *            LALV_MaxGrowY (LONG) - Maximum height of this object
  2662. *                measured in lines. When the first layout pass is
  2663. *                finished and there is still enough space left to
  2664. *                make the listview higher, the height is increased
  2665. *                until it hits the limit specified using this tag.
  2666. *
  2667. *                    NOTE: there can be only one single listview
  2668. *                        per window to sport this feature.
  2669. *
  2670. *                Default: 0
  2671. *
  2672. *            LALV_ResizeX (BOOL) - Makes this listview resizable
  2673. *                in the horizontal direction, attaches a sizing
  2674. *                gadget to the window to open and handles window
  2675. *                resize operations automatically. (V9)
  2676. *
  2677. *                    NOTE: there can be only one single listview
  2678. *                        per window to sport this feature.
  2679. *
  2680. *                        Also listen to IDCMP_CLOSEWINDOW events
  2681. *                        which may be generated if the layout
  2682. *                        engine runs out of memory when rebuilding
  2683. *                        the user interface.
  2684. *
  2685. *                Default: FALSE
  2686. *
  2687. *            LALV_ResizeY (BOOL) - Makes this listview resizable
  2688. *                in the vertical direction, attaches a sizing
  2689. *                gadget to the window to open and handles window
  2690. *                resize operations automatically. (V9)
  2691. *
  2692. *                    NOTE: there can be only one single listview
  2693. *                        per window to sport this feature.
  2694. *
  2695. *                        Also listen to IDCMP_CLOSEWINDOW events
  2696. *                        which may be generated if the layout
  2697. *                        engine runs out of memory when rebuilding
  2698. *                        the user interface.
  2699. *
  2700. *                Default: FALSE
  2701. *
  2702. *            LALV_MinChars (WORD) - Minimum width for this
  2703. *                object, measured in characters. Used in
  2704. *                conjunction with LALV_ResizeX. (V9)
  2705. *
  2706. *            LALV_MinLines (WORD) - Minimum height for this
  2707. *                object, measured in lines. Used in
  2708. *                conjunction with LALV_ResizeY. (V9)
  2709. *
  2710. *            LALV_LockSize (BOOL) - After doing the initial layout
  2711. *                for this object, do not adapt its size again during
  2712. *                subsequent layouts. This is particularly useful if
  2713. *                you have a LISTVIEW_KIND object in a paged group
  2714. *                and keep adding new entries to the list. You need
  2715. *                to specify an object width using LA_Chars, otherwise
  2716. *                the layout engine may make it not wide enough to
  2717. *                display any entries. (V8)
  2718. *
  2719. *            LALV_FlushLabelLeft (BOOL) - For a gadget label placed
  2720. *                above the listview align the text to the left edge
  2721. *                of the view. (V9)
  2722. *
  2723. *            LALV_TextAttr (struct TextAttr *) - You can specify a
  2724. *                fixed-width font to be used for the list display.
  2725. *                The TextAttr (or TTextAttr) you provide must be ready
  2726. *                to go so the layout code can open the font later.
  2727. *
  2728. *                To get the current system default font, which is
  2729. *                guaranteed to be fixed-width, pass ~0 instead of a
  2730. *                pointer to a TextAttr structure. (V10)
  2731. *
  2732. *                    NOTE: The font *MUST* be fixed-width or the layout
  2733. *                        will fail.
  2734. *
  2735. *                         Choose your font in such a way that it matches
  2736. *                         in width and height with the other probably
  2737. *                         proportional-spaced user interface font.
  2738. *
  2739. *                         If the layout engine decides to step down in
  2740. *                         font size, all LISTVIEW_KIND objects which were
  2741. *                         configured to use a special fixed-width font
  2742. *                         will `forget' about it. This won't matter much
  2743. *                         as the fonts the engine chooses will always be
  2744. *                         fixed-width anyway.
  2745. *
  2746. *            LALV_AutoPageID (LONG) - ID of paged GROUP_KIND object
  2747. *                which will be set to the gadget's current setting.
  2748. *                If this tag is set, you will hear no events from this
  2749. *                object any more. (V23)
  2750. *
  2751. *                    NOTE: Listen to IDCMP_CLOSEWINDOW events
  2752. *                        which may be generated if the layout
  2753. *                        engine runs out of memory when rebuilding
  2754. *                        the user interface.
  2755. *
  2756. *            LALV_Selected (LONG) - In this context, this tag is an
  2757. *                alias for GTLV_Selected. See
  2758. *                gtlayout.library/LT_SetAttributes for more information
  2759. *                on how the meaning of this tag differs from this (V34).
  2760. *
  2761. *        INTEGER_KIND:
  2762. *
  2763. *            LAIN_LastGadget (BOOL) - Pressing return with this
  2764. *                gadget active will stop activating the next
  2765. *                following string gadget type if TRUE is passed.
  2766. *                Default: FALSE
  2767. *
  2768. *            LAIN_Min (LONG) - Minimum accepted numeric value.
  2769. *                Default: -2147483647
  2770. *
  2771. *            LAIN_Max (LONG) - Maximum accepted numeric value.
  2772. *                Default:  2147483647
  2773. *
  2774. *            LAIN_UseIncrementers (BOOL) - Use TRUE to add incrementer
  2775. *                arrow buttons to the right of the numeric entry field.
  2776. *                These buttons will let you cycle through a set of
  2777. *                numbers to be displayed in the numeric entry field.
  2778. *                Default: FALSE
  2779. *
  2780. *            LAIN_HistoryLines (LONG) - Number of numbers entered to
  2781. *                keep as a backlog.
  2782. *                Default: 0
  2783. *
  2784. *            LAIN_HistoryHook (struct Hook *) - Hook code to call when
  2785. *                entering a number into the backlog. See gtlayout.h for
  2786. *                more information.
  2787. *                Default: NULL
  2788. *
  2789. *            LAIN_IncrementerHook (struct Hook *) - Hook code to call
  2790. *                when cycling through numeric values. See gtlayout.h for
  2791. *                more information.
  2792. *                Default: NULL
  2793. *
  2794. *            LAIN_Activate (BOOL) - When the window opens, make this
  2795. *                gadget the active one. (V21)
  2796. *
  2797. *                    NOTE: There can be only one gadget of this type
  2798. *                        per window.
  2799. *
  2800. *                Default: FALSE
  2801. *
  2802. *
  2803. *        STRING_KIND:
  2804. *
  2805. *            LAST_LastGadget (BOOL) - Pressing return with this
  2806. *                gadget active will stop activating the next
  2807. *                following string gadget type if TRUE is passed.
  2808. *                Default: FALSE
  2809. *
  2810. *            LAST_Link (LONG) - Gadget ID of the listview to attach
  2811. *                this string gadget to.
  2812. *
  2813. *                    NOTE: you need to add the string gadget before
  2814. *                        you add the listview to refer to it or the
  2815. *                        layout routine will get confused.
  2816. *
  2817. *            LAST_Picker (BOOL) - Attach a `select' button to the
  2818. *                right hand side of the string gadget.
  2819. *                Default: FALSE
  2820. *
  2821. *            LAST_HistoryLines (LONG) - Number of lines to keep as
  2822. *                a backlog.
  2823. *                Default: 0
  2824. *
  2825. *            LAST_HistoryHook (struct Hook *) - Hook code to call
  2826. *                when entering a line into the backlog. See gtlayout.h
  2827. *                for more information.
  2828. *                Default: NULL
  2829. *
  2830. *            LAST_Activate (BOOL) - When the window opens, make this
  2831. *                gadget the active one. (V21)
  2832. *
  2833. *                    NOTE: There can be only one gadget of this type
  2834. *                        per window.
  2835. *
  2836. *                Default: FALSE
  2837. *
  2838. *        PASSWORD_KIND (string gadget type which does not
  2839. *            display its contents):
  2840. *
  2841. *            LAPW_LastGadget (BOOL) - Pressing return with this
  2842. *                gadget active will stop activating the next
  2843. *                following string gadget type if TRUE is passed.
  2844. *                Default: FALSE
  2845. *
  2846. *            LAPW_HistoryLines (LONG) - Number of lines to keep as
  2847. *                a backlog.
  2848. *                Default: 0
  2849. *
  2850. *            LAPW_HistoryHook (struct Hook *) - Hook code to call
  2851. *                when entering a line into the backlog. See gtlayout.h
  2852. *                for more information.
  2853. *                Default: NULL
  2854. *
  2855. *            LAPW_Activate (BOOL) - When the window opens, make this
  2856. *                gadget the active one. (V21)
  2857. *
  2858. *                    NOTE: There can be only one gadget of this type
  2859. *                        per window.
  2860. *
  2861. *                Default: FALSE
  2862. *
  2863. *            This object type accepts all the GTST_#? tag items.
  2864. *
  2865. *
  2866. *        PALETTE_KIND:
  2867. *
  2868. *            LAPA_SmallPalette (BOOL) - Make the palette display
  2869. *                a bit smaller than usual.
  2870. *                Default: FALSE
  2871. *
  2872. *            LAPA_Lines (LONG) - Number of lines the palette
  2873. *                display should cover.
  2874. *                Default: No preference
  2875. *
  2876. *            LAPA_UsePicker (BOOL) - This tag effectively changes the
  2877. *                gadget type. Instead of a list of colours to pick from
  2878. *                the user will see a rectangle filled in the selected
  2879. *                colour with a picker button next to it. This gadget
  2880. *                will generate IDCMP_IDCMPUPDATE events when the picker
  2881. *                button is pressed. (V10)
  2882. *
  2883. *
  2884. *        BUTTON_KIND:
  2885. *
  2886. *            LA_Label (STRPTR)
  2887. *            LA_LabelID (LONG) - These two define the button label, i.e.
  2888. *                the text that is printed within the button box. Optionally,
  2889. *                this text may include newline characters ("\n") which will
  2890. *                cause the button text to be broken into several lines.
  2891. *                This particular feature requires gtlayout.library v12 or
  2892. *                higher. Single line label have always been supported.
  2893. *
  2894. *            LABT_ReturnKey (BOOL) - Let the user operate this
  2895. *                button by pressing the return key, making it the
  2896. *                so-called default button, or default choice. The
  2897. *                button select box will appear slightly bolder than
  2898. *                normal buttons are.
  2899. *
  2900. *                    NOTE: there can be only one single button per
  2901. *                        window to sport this feature.
  2902. *
  2903. *                Default: FALSE
  2904. *
  2905. *            LABT_EscKey (BOOL) - Let the user operate this
  2906. *                button by pressing the Escape key.
  2907. *
  2908. *                    NOTE: there can be only one single button per
  2909. *                        window to use this feature.
  2910. *
  2911. *                Default: FALSE
  2912. *
  2913. *            LABT_ExtraFat (BOOL) - Make this button a bit
  2914. *                larger than usual.
  2915. *                Default: FALSE
  2916. *
  2917. *            LABT_Lines (STRPTR *) - Use the given string array
  2918. *                to create a multiline gadget label. Terminate the
  2919. *                array with a NULL. (V12)
  2920. *
  2921. *            LABT_FirstLine (LONG) - Locale ID of first label line. (V12)
  2922. *
  2923. *            LABT_LastLine (LONG) - Locale ID of last label line. (V12)
  2924. *
  2925. *            LABT_DefaultCorrection (BOOL) - Make the button slightly
  2926. *                wider and taller so its size matches the default
  2927. *                button. (V21)
  2928. *
  2929. *            LABT_Smaller (BOOL) - Make this button a little smaller
  2930. *                than usual. (V21)
  2931. *
  2932. *        GAUGE_KIND (general purpose progress report display):
  2933. *
  2934. *            LAGA_Percent (LONG) - Indicator position, can range
  2935. *                from 0..100.
  2936. *                Default: 0
  2937. *
  2938. *            LAGA_InfoLength (LONG) - Maximum number of characters
  2939. *                to reserve for text printed in the gauge display.
  2940. *                Default: 0
  2941. *
  2942. *            LAGA_InfoText (STRPTR) - Text to print in the gauge
  2943. *                display.
  2944. *
  2945. *            LAGA_Tenth (BOOL) - Instead of a continuously growing
  2946. *                bar you will get a set of exactly ten blocks,
  2947. *                each separated by a hairline. (V19)
  2948. *                Default: FALSE
  2949. *
  2950. *               LAGA_NoTicks (BOOL) - If TRUE suppresses drawing the
  2951. *                   ticks below the gauge box.
  2952. *                   Default: FALSE
  2953. *
  2954. *        CYCLE_KIND:
  2955. *
  2956. *            LACY_FirstLabel (LONG) - Locale string ID of the first
  2957. *                text to use as a label. Works in conjunction
  2958. *                with LACY_LastLabel.
  2959. *
  2960. *            LACY_LastLabel (LONG) - Locale string ID of the last
  2961. *                text to use as a label. Works in conjunction
  2962. *                with LACY_FirstLabel. When building the interface the
  2963. *                code will loop from FirstLabel..LastLabel, look
  2964. *                up the corresponding locale strings and use the
  2965. *                data to make up the label text.
  2966. *
  2967. *            LACY_LabelTable (LONG *) - Pointer to an array of IDs
  2968. *                to use for building the cycle labels. This requires
  2969. *                that a locale hook is provided with the layout handle.
  2970. *                The array is terminated by -1.
  2971. *
  2972. *            LACY_TabKey (BOOL) - Connect this object to the tabulator
  2973. *                key. Press [Tab] to cycle to the next entry, [Shift][Tab]
  2974. *                to cycle to the previous entry. (V9)
  2975. *
  2976. *                    NOTE: there can be only one single button per
  2977. *                        window to use this feature.
  2978. *
  2979. *                Default: FALSE
  2980. *
  2981. *            LACY_AutoPageID (LONG) - ID of paged GROUP_KIND object
  2982. *                which will be set to the gadget's current setting.
  2983. *                If this tag is set, you will hear no events from this
  2984. *                object any more. (V7)
  2985. *
  2986. *                    NOTE: Listen to IDCMP_CLOSEWINDOW events
  2987. *                        which may be generated if the layout
  2988. *                        engine runs out of memory when rebuilding
  2989. *                        the user interface.
  2990. *
  2991. *
  2992. *        POPUP_KIND:
  2993. *
  2994. *            (This features requires gtlayout.library v22 or higher
  2995. *             and Kickstart 3.0 or higher).
  2996. *
  2997. *            LAPU_FirstLabel (LONG) - Locale string ID of the first
  2998. *                text to use as a label. Works in conjunction
  2999. *                with LAPU_LastLabel.
  3000. *
  3001. *            LAPU_LastLabel (LONG) - Locale string ID of the last
  3002. *                text to use as a label. Works in conjunction
  3003. *                with LAPU_FirstLabel. When building the interface the
  3004. *                code will loop from FirstLabel..LastLabel, look
  3005. *                up the corresponding locale strings and use the
  3006. *                data to make up the label text.
  3007. *
  3008. *            LAPU_LabelTable (LONG *) - Pointer to an array of IDs
  3009. *                to use for building the cycle labels. This requires
  3010. *                that a locale hook is provided with the layout handle.
  3011. *                The array is terminated by -1.
  3012. *
  3013. *            LAPU_TabKey (BOOL) - Connect this object to the tabulator
  3014. *                key. Press [Tab] to cycle to the next entry, [Shift][Tab]
  3015. *                to cycle to the previous entry.
  3016. *
  3017. *                    NOTE: there can be only one single button per
  3018. *                        window to use this feature.
  3019. *
  3020. *                Default: FALSE
  3021. *
  3022. *            LAPU_AutoPageID (LONG) - ID of paged GROUP_KIND object
  3023. *                which will be set to the gadget's current setting.
  3024. *                If this tag is set, you will hear no events from this
  3025. *                object any more.
  3026. *
  3027. *                    NOTE: Listen to IDCMP_CLOSEWINDOW events
  3028. *                        which may be generated if the layout
  3029. *                        engine runs out of memory when rebuilding
  3030. *                        the user interface.
  3031. *
  3032. *            LAPU_CentreActive (BOOL) - If TRUE, the popup menu will
  3033. *                appear with the currently active entry centred below
  3034. *                the mouse pointer. (V31)
  3035. *
  3036. *        TAB_KIND:
  3037. *
  3038. *            (This features requires gtlayout.library v24 or higher)
  3039. *
  3040. *            LATB_FirstLabel (LONG) - Locale string ID of the first
  3041. *                text to use as a label. Works in conjunction
  3042. *                with LATB_LastLabel.
  3043. *
  3044. *            LATB_LastLabel (LONG) - Locale string ID of the last
  3045. *                text to use as a label. Works in conjunction
  3046. *                with LATB_FirstLabel. When building the interface the
  3047. *                code will loop from FirstLabel..LastLabel, look
  3048. *                up the corresponding locale strings and use the
  3049. *                data to make up the label text.
  3050. *
  3051. *            LATB_LabelTable (LONG *) - Pointer to an array of IDs
  3052. *                to use for building the cycle labels. This requires
  3053. *                that a locale hook is provided with the layout handle.
  3054. *                The array is terminated by -1.
  3055. *
  3056. *            LATB_TabKey (BOOL) - Connect this object to the tabulator
  3057. *                key. Press [Tab] to cycle to the next entry, [Shift][Tab]
  3058. *                to cycle to the previous entry.
  3059. *
  3060. *                    NOTE: there can be only one single button per
  3061. *                        window to use this feature.
  3062. *
  3063. *                Default: FALSE
  3064. *
  3065. *            LATB_AutoPageID (LONG) - ID of paged GROUP_KIND object
  3066. *                which will be set to the gadget's current setting.
  3067. *                If this tag is set, you will hear no events from this
  3068. *                object any more.
  3069. *
  3070. *                    NOTE: Listen to IDCMP_CLOSEWINDOW events
  3071. *                        which may be generated if the layout
  3072. *                        engine runs out of memory when rebuilding
  3073. *                        the user interface.
  3074. *
  3075. *            LATB_FullSize (BOOL) - By default a TAB_KIND object
  3076. *                covers the entire width of the group it sits in.
  3077. *                With LATB_FullSize set to true it will cover the
  3078. *                width of the entire Window.
  3079. *
  3080. *                Default: FALSE
  3081. *
  3082. *
  3083. *        MX_KIND:
  3084. *
  3085. *            LAMX_FirstLabel (LONG) - Locale string ID of the first
  3086. *                text to use as a label. Works in conjunction
  3087. *                with LAMX_LastLabel.
  3088. *
  3089. *            LAMX_LastLabel (LONG) - Locale string ID of the last
  3090. *                text to use as a label. Works in conjunction
  3091. *                with LAMX_FirstLabel. When building the interface the
  3092. *                code will loop from FirstLabel..LastLabel, look
  3093. *                up the corresponding locale strings and use the
  3094. *                data to make up the label text.
  3095. *
  3096. *            LAMX_LabelTable (LONG *) - Pointer to an array of IDs
  3097. *                to use for building the radio labels. This requires
  3098. *                that a locale hook is provided with the layout handle.
  3099. *                The array is terminated by -1.
  3100. *
  3101. *            LAMX_TabKey (BOOL) - Connect this object to the tabulator
  3102. *                key. Press [Tab] to cycle to the next entry, [Shift][Tab]
  3103. *                to cycle to the previous entry. (V9)
  3104. *
  3105. *                    NOTE: there can be only one single button per
  3106. *                        window to use this feature.
  3107. *
  3108. *                Default: FALSE
  3109. *
  3110. *            LAMX_AutoPageID (LONG) - ID of paged GROUP_KIND object
  3111. *                which will be set to the gadget's current setting.
  3112. *                If this tag is set, you will hear no events from this
  3113. *                object any more. (V7)
  3114. *
  3115. *                    NOTE: Listen to IDCMP_CLOSEWINDOW events
  3116. *                        which may be generated if the layout
  3117. *                        engine runs out of memory when rebuilding
  3118. *                        the user interface.
  3119. *
  3120. *
  3121. *        SCROLLER_KIND:
  3122. *
  3123. *            LASC_Thin (BOOL) - Make the scroller a bit thinner
  3124. *                than usual.
  3125. *                Default: FALSE
  3126. *
  3127. *            GA_RelVerify (BOOL) - Hear every IDCMP_GADGETUP
  3128. *                event from scroller.
  3129. *                Default: TRUE
  3130. *
  3131. *                        NOTE: This is different from what
  3132. *                         gadtools.library uses.
  3133. *
  3134. *            GA_Immediate (BOOL) - Hear every IDCMP_GADGETDOWN
  3135. *                event from scroller
  3136. *                Default: TRUE
  3137. *
  3138. *                        NOTE: This is different from what
  3139. *                         gadtools.library uses.
  3140. *
  3141. *        TAPEDECK_KIND:
  3142. *
  3143. *            LATD_ButtonType (LONG) - Select the image to display
  3144. *                in the button, must be one of the following:
  3145. *
  3146. *                    TDBT_BACKWARD
  3147. *                        "<<" Symbol
  3148. *
  3149. *                    TDBT_FORWARD
  3150. *                        ">>" Symbol
  3151. *
  3152. *                    TDBT_PREVIOUS
  3153. *                        "|<" Symbol
  3154. *
  3155. *                    TDBT_NEXT
  3156. *                        ">|" Symbol
  3157. *
  3158. *                    TDBT_STOP
  3159. *                        Stop symbol (filled square)
  3160. *
  3161. *                    TDBT_PAUSE
  3162. *                        "||" pause symbol (broken square)
  3163. *
  3164. *                    TDBT_RECORD
  3165. *                        Record symbol (filled circle)
  3166. *
  3167. *                    TDBT_REWIND
  3168. *                        "<" symbol
  3169. *
  3170. *                    TDBT_EJECT
  3171. *                        Eject symbol (broken upward pointing arrow)
  3172. *
  3173. *                    TDBT_PLAY
  3174. *                        ">" symbol
  3175. *
  3176. *            LATD_Toggle (BOOL) - Make this object a toggle-select
  3177. *                button.
  3178. *                Default: FALSE
  3179. *
  3180. *            LATD_Pressed (BOOL) - Make this button appear to be
  3181. *                pressed.
  3182. *
  3183. *                    NOTE: requires "LATD_Toggle,TRUE" attribute.
  3184. *
  3185. *                Default: FALSE
  3186. *
  3187. *            LATD_Smaller (BOOL) - Make this button a bit smaller
  3188. *                than usual.
  3189. *                Default: FALSE
  3190. *
  3191. *            LATD_Tick (BOOL) - Hear IDCMP_GADGETUP events while the
  3192. *                buttons is being pressed; the IntuiMessage->Code entry
  3193. *                will be 0 while the button is being pressed, and
  3194. *                will be 1 as soon as the button is released. (V12)
  3195. *
  3196. *                Default: FALSE
  3197. *
  3198. *
  3199. *        BOOPSI_KIND:
  3200. *
  3201. *            (requires gtlayout.library v10 or higher)
  3202. *
  3203. *            LABO_TagCurrent (Tag) - The Tag ID that represents the
  3204. *                current object value. For PROPGCLASS this would be
  3205. *                PGA_Top.
  3206. *
  3207. *            LABO_TagTextAttr (Tag) - The Tag ID that represents the
  3208. *                TextAttr value the object expects. For gadgets this
  3209. *                would be GA_TextAttr.
  3210. *
  3211. *            LABO_TagDrawInfo (Tag) - The Tag ID that represents the
  3212. *                DrawInfo value the object expects.
  3213. *
  3214. *            LABO_TagLink (Tag) - The Tag ID that represents a pointer
  3215. *                to a different object the object expects. For the
  3216. *                colorwheel.gadget this would be WHEEL_GradientSlider.
  3217. *
  3218. *            LABO_TagScreen (Tag) - The Tag ID that represents the
  3219. *                screen the object expects. For the colorwheel.gadget
  3220. *                this would be WHEEL_Screen.
  3221. *
  3222. *            LABO_Link (LONG) - The ID of the object this object should
  3223. *                be linked to. This will be resolved later when gadgets
  3224. *                are created.
  3225. *
  3226. *                    NOTE: Forward references are not resolved, only
  3227. *                        backward references are allowed. This means that
  3228. *                        if you wish to link object A to object B,
  3229. *                        object A must be created before object B
  3230. *                        is created.
  3231. *
  3232. *            LABO_ClassInstance (Class *) - This is the first parameter
  3233. *                you would pass to NewObjectA().
  3234. *
  3235. *                    NOTE: Only classes derived from gadgetclass and
  3236. *                      gadgetclass itself may be used.
  3237. *
  3238. *            LABO_ClassName (STRPTR) - This is the second parameter you would
  3239. *                pass to NewObject().
  3240. *
  3241. *                    NOTE: Only classes derived from gadgetclass and
  3242. *                        gadgetclass itself may be used.
  3243. *
  3244. *            LABO_ClassLibraryName (STRPTR) - This tag is particularly useful
  3245. *                for gadget class implementations wrapped into libraries, such as
  3246. *                colorwheel.gadget. When opened, they make the classes they
  3247. *                represent publicly available so subsequent calls to
  3248. *                NewObject(NULL,<Classname>,...) can be made. The
  3249. *                LABO_ClassLibraryName tag will cause gtlayout.library to open
  3250. *                the class library before any calls to NewObject() are made.
  3251. *
  3252. *                    NOTE: Only classes derived from gadgetclass and
  3253. *                        gadgetclass itself may be used.
  3254. *
  3255. *                        The LABO_ClassLibraryName tag requires that you
  3256. *                        specify the class name with the LABO_ClassName. It is
  3257. *                        not enough to just use the LABO_ClassLibraryName tag.
  3258. *
  3259. *            LABO_ExactWidth (WORD) - This is the exact width of the object to
  3260. *                use. This effectively overrides whatever you specified using
  3261. *                the LA_Chars tag and keeps gtlayout.library from shrinking and
  3262. *                expanding the object as needed.
  3263. *
  3264. *            LABO_ExactHeight (WORD) - This is the exact height of the object to
  3265. *                use. This effectively overrides whatever you specified using
  3266. *                the LA_Lines tag and keeps gtlayout.library from shrinking and
  3267. *                expanding the object as needed.
  3268. *
  3269. *            LABO_RelFontHeight (WORD) - This tag affects the height of the
  3270. *                object; when specified, it is derived from the user interface
  3271. *                font height plus the value given with LABO_RelFontHeight.
  3272. *
  3273. *            LABO_FullWidth (BOOL) - Use this tag if you wish the object to
  3274. *                cover the entire width of the group it resides within.
  3275. *
  3276. *            LABO_FullHeight (BOOL) - Use this tag if you wish the object to
  3277. *                cover the entire height of the group it resides within.
  3278. *
  3279. *            LABO_ActivateHook (struct Hook *) - Hook to invoke when the
  3280. *                layout engine decides that this particular object should
  3281. *                be activated. The hook is called with the following
  3282. *                parameters:
  3283. *
  3284. *                Success = ActivateFunc(struct Hook *Hook,LayoutHandle *Handle,
  3285. *                  D0                                 A0                  A2
  3286. *
  3287. *                             Object *object)
  3288. *                                       A1
  3289. *
  3290. *                The object pointer actually refers to the instance of the
  3291. *                BOOPSI object created. Return FALSE if your object could not
  3292. *                be activated, TRUE if it worked. If you return TRUE, no special
  3293. *                keyboard event will be generated. (V13)
  3294. *
  3295. *            NOTE: All tags passed to LT_New() for BOOPSI_KIND objects are
  3296. *                passed through to NewObjectA() later. The library makes
  3297. *                a copy of the tag item list, so all data valid in the
  3298. *                scope when LT_New() is called must also be valid later
  3299. *                when LT_Build() is invoked.
  3300. *
  3301. *                The gadget label is *NOT* passed through to the object,
  3302. *                it effectively receives the label a plain gadtools object
  3303. *                would receive, similar to what happens to FRAME_KIND
  3304. *                objects and the like.
  3305. *
  3306. *   RESULT
  3307. *    none
  3308. *
  3309. *   BUGS
  3310. *    Up to v25 the SCROLLER_KIND object did not support GA_Immediate
  3311. *    or GA_RelVerify. The space for the variables was there, but the
  3312. *    code was missing.
  3313. *
  3314. *    POPUP_KIND objects don't work well in simple refresh windows,
  3315. *    as refresh events can get lost. Use a smart refresh window
  3316. *    instead or call gadtools.library/LT_CatchUpRefresh() regularly.
  3317. *
  3318. *   SEE ALSO
  3319. *    gadtools.library/CreateGadgetA
  3320. *
  3321. ******************************************************************************
  3322. *
  3323. */
  3324.  
  3325. VOID LIBENT
  3326. LT_NewA(REG(a0) LayoutHandle *handle,REG(a1) struct TagItem *tagList)
  3327. {
  3328.     if(handle)
  3329.     {
  3330.         struct TagItem *List,*Entry;
  3331.         STRPTR label;
  3332.         LONG type;
  3333.         LONG id;
  3334.  
  3335.         type    = -1;
  3336.         label    = NULL;
  3337.         id        = 0;
  3338.         List    = tagList;
  3339.  
  3340.         while(Entry = NextTagItem(&List))
  3341.         {
  3342.             switch(Entry->ti_Tag)
  3343.             {
  3344.                 case LA_Type:
  3345.  
  3346.                     type = Entry->ti_Data;
  3347.                     break;
  3348.  
  3349.                 case LA_ID:
  3350.  
  3351.                     id = Entry->ti_Data;
  3352.                     break;
  3353.  
  3354.                 case LA_LabelID:
  3355.  
  3356.                     if(handle->LocaleHook)
  3357.                         label = (STRPTR)CallHookPkt(handle->LocaleHook,handle,(APTR)Entry->ti_Data);
  3358.                     else
  3359.                     {
  3360.                         handle->Failed = TRUE;
  3361.  
  3362.                         return;
  3363.                     }
  3364.  
  3365.                     break;
  3366.  
  3367.                 case LA_LabelText:
  3368.  
  3369.                     label = (STRPTR)Entry->ti_Data;
  3370.                     break;
  3371.             }
  3372.         }
  3373.  
  3374.         LT_AddA(handle,type,label,id,tagList);
  3375.     }
  3376. }
  3377.  
  3378.  
  3379. /*****************************************************************************/
  3380.  
  3381.  
  3382. /****** gtlayout.library/LT_EndGroup ******************************************
  3383. *
  3384. *   NAME
  3385. *    LT_EndGroup -- end a group declaration.
  3386. *
  3387. *   SYNOPSIS
  3388. *    LT_EndGroup(Handle);
  3389. *                 A0
  3390. *
  3391. *    VOID LT_EndGroup(LayoutHandle *);
  3392. *
  3393. *   FUNCTION
  3394. *      This is just a short form of
  3395. *
  3396. *           LT_New(Handle,
  3397. *               LA_Type, END_KIND,
  3398. *           TAG_DONE);
  3399. *
  3400. *      It helps to save (some) space.
  3401. *
  3402. *   INPUTS
  3403. *        Handle - Pointer to LayoutHandle.
  3404. *
  3405. *   RESULT
  3406. *    none
  3407. *
  3408. *   SEE ALSO
  3409. *    gtlayout.library/LT_New
  3410. *
  3411. ******************************************************************************
  3412. *
  3413. */
  3414.  
  3415. VOID LIBENT
  3416. LT_EndGroup(REG(a0) LayoutHandle *handle)
  3417. {
  3418.     if(handle && !handle->Failed)
  3419.         handle->CurrentGroup = handle->CurrentGroup->Special.Group.ParentGroup;
  3420. }
  3421.